A file watching service
Watches files and records, or triggers actions, when they change.
Watchman exists to watch files and record when they change. It can also trigger actions (such as rebuilding assets) when matching files change.
These two lines establish a watch on a source directory and then set up a trigger named buildme that will run a tool named minify-css whenever a CSS file is changed. The tool will be passed a list of the changed filenames.
minify-css
$ watchman watch ~/src # the single quotes around '*.css' are important! $ watchman -- trigger ~/src buildme '*.css' -- minify-css
The output for buildme will land in the Watchman log file unless you send it somewhere else.