File watching
last updated: Jul 03, 2024
- modd
- with related project devd, a development webserver
- this is what I usually use, it's not maintained but it works fine enough
- watchexec (github) (cargo)
- I've not used it, but it looks like it would do the job without much fuss
- available on brew with
brew install watchexec
- fswatch (github)
- looks to be very full featured, but the CLI is too complex for casual usage
- Paul Smith wrote a simple bash reloader that wraps it
- entr (github)
- you pipe a file list into
entr
instead of watching by a glob, which makes it tricky to notice when files are added
- you pipe a file list into
- watchman (github)
- To run a command when a js or ts files changes, use
watchman-make
, Example: watchman-make -p '**/*.js' '**/*.ts' --run 'npx jest'
- docs
- does not seem to support extended glob syntax, so you can't use
**/*.{js,ts}
as the value provided to the-p
option
- To run a command when a js or ts files changes, use
- watchfiles (github)
- Simple, modern and high performance file watching and code reload in python.
- both a python lib and a cli tool
- the cli is very python-oriented
watchfiles "go test" **/*.go
works as advertised though, and runsgo test
when any go file changes- it has a reasonably low file limit, which can be a problem in node setups with node_modules
- In that case, use something like:
watchfiles "npx jest" $(fd -g --exclude node_modules "*.{ts,js}"
- reflex
- a golang file watcher that looks pretty good, supports config files
- turbowatch
- a scriptable node file watcher built on top of watchman. I used it in my [[uswds]] template project, and it seemed nice
- gow
- "Go Watch: missing watch mode for theÂ
go
 command. It's invoked exactly likeÂgo
, but also watches Go files and reruns on changes." - only for go
- based on rjeczalik/notify, like modd is
- "Go Watch: missing watch mode for theÂ
- gaze
- a file watcher that is optimized around running files immediately after you save them; by default it tries to guess how to run the file.
- so if you run
gaze .
and edit a filesomething.py
, it will runpython something.py
every time you save, by guessing that you want to run the file withpython
- you can customize the mapping with the
-c
option
- air
- designed particularly for watching go apps, but customizable build and run commands
Backlinks: