https://github.com/elsehow/runwatch
watch some files, run a command (when the files change)
https://github.com/elsehow/runwatch
Last synced: about 1 month ago
JSON representation
watch some files, run a command (when the files change)
- Host: GitHub
- URL: https://github.com/elsehow/runwatch
- Owner: elsehow
- License: bsd-3-clause
- Created: 2016-04-27T17:21:16.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-15T19:31:54.000Z (almost 4 years ago)
- Last Synced: 2025-03-21T15:19:57.676Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# runwatch
watches some files, runs a thing
## example
```
runwatch *.js -r "npm start"
```runs `npm start` and watches everything that matches `*.js*`.
when any `.js` file changes, it will SIGINT the old process (as if you pressed C-c), and re-runs `npm start`## install
```
npm install -g runwatch
```
## example```
echo "echo \"hello\"" > test.sh
runwatch test.sh -r "bash test.sh"
```now modify test.sh, and watch the script re-run!
## about
heavily inspired by [npm-watch](https://www.npmjs.com/package/npm-watch), but with a few differences:
- runs from the command line, no npm dependencies
- uses [file globs](https://github.com/isaacs/node-glob) for advanaced filename matching
- when the watched script errors, it prints *only* the error, with no npm erroring boilerplate (!)
- no nodemon dependencies - just `child_process.spawn()`## license
BSD