Executes commands in response to file modifications
open sourceApache-2.0self-hostablefree
watchexec watches a path and runs a command whenever it detects changes. It coalesces bursts of filesystem events, honours .gitignore and .ignore, uses process groups to keep hold of forking programs, can restart long-running servers, and passes the changed paths in environment variables or stdin. It is language-agnostic and runs on macOS, Linux and Windows.
Ways to install
Package managers
Problems it solves
- rerun my tests automatically every time I save a file
- restart my dev server when source files change
- nodemon but for any language, not just Node
- entr needs a find pipeline and does not restart servers well
- rebuild assets when CSS or HTML files change
- file watcher that ignores everything in .gitignore
- editors that write temp files trigger my watcher several times
- run a linter on change across Mac, Linux and Windows
Features
- event coalescing
- .gitignore support
- restart mode
- process group handling
- changed paths in env/stdin
- filters by extension
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what watchexec does.