talira

Watchman

A file watching service that records changes and triggers actions

open sourceMITfree

Watchman is Meta's file watching service: it recursively watches directory trees (roots), records when files actually change, and can trigger actions, such as rebuilding assets, when matching files change. Clients query a root for the changes since they last checked or for its current state, or subscribe to changes as they happen; Watchman waits for a root to settle before notifying, errs on the side of reporting files as changed, and doesn't follow symlinks.

Ways to install

Package managers

Problems it solves

  • rebuild assets automatically when a source file changes
  • efficiently find which files changed since my tool last ran in a huge repository
  • run a command whenever CSS files change

Features

  • recursive watches on directory trees
  • query changes since a clock, or subscribe to them
  • triggers that run a command when matching files change
  • waits for a tree to settle before notifying

Alternatives

The same job

These do what Watchman does.

  1. watchexec Executes commands in response to file modifications
  2. Chokidar Cross-platform file watching library for Node.js
  3. Guard Run commands automatically when files change, for Ruby projects
  4. entr Run arbitrary commands when files change
  5. nodemon Restart your Node.js app automatically when files change

Compare Watchman with the top 3