Very simple CLI tool to cheaply watch files and run a command on changes.
This is basically a command line wrapper of conduitry/cheap-watch, meant to be used during development of simple libraries.
The normal ways:
npm install chwatch
Or just use it:
npx chwatch <ARGS>
The CLI takes any number of input strings as regex matchers, but the last one is the command to execute.
Example: watch for any *.js
file changes in a src
directory, and run npm run build
if any change.
chwatch "src/.+\.js$" "npm run build"
Example: like the above example, but also watch *.md
files in a docs
directory.
chwatch "src/.+\.js$" "docs/.+\.md$" "npm run build"
It always executes in the context of whatever directory you run it in.
Published and released under the Very Open License.