talira

FileSystem (Elixir)

Watch files for changes from Elixir on macOS, Linux, BSD and Windows

open sourceApache-2.0free

FileSystem is an Elixir library that watches directories for file changes, wrapping each operating system's native listener: fsevent on macOS, inotify on Linux and the BSDs, and inotify-win on Windows. You start a watcher for some directories, subscribe a process to it, and that process receives a {:file_event, pid, {path, events}} message for each change, with backend options such as latency on macOS.

Problems it solves

  • react to file changes in a directory from an Elixir app
  • reload code or assets when a file changes during development
  • watch files the same way on macOS, Linux and Windows from Elixir

Features

  • native file watching on macOS (fsevent), Linux and the BSDs (inotify) and Windows (inotify-win)
  • subscribe any process to a watcher and receive file events as messages
  • named watchers and per-backend options such as latency

Alternatives

The same job

These do what FileSystem (Elixir) does.

  1. fs (Erlang) Native filesystem change listener for Erlang and Elixir on macOS, Windows and Linux

Compare FileSystem (Elixir) with the top 3