Skip to content

Cheaply watch files and execute command if changed.

License

Notifications You must be signed in to change notification settings

saibotsivad/chwatch

Repository files navigation

chwatch

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.

Install

The normal ways:

npm install chwatch

Or just use it:

npx chwatch <ARGS>

Using

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.

License

Published and released under the Very Open License.

About

Cheaply watch files and execute command if changed.

Resources

License

Stars

Watchers

Forks

Packages

No packages published