Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/watch-js
watch clone in node.js
https://github.com/stagas/watch-js
Last synced: 13 days ago
JSON representation
watch clone in node.js
- Host: GitHub
- URL: https://github.com/stagas/watch-js
- Owner: stagas
- Created: 2013-03-02T15:45:24.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-08T13:25:05.000Z (about 9 years ago)
- Last Synced: 2024-04-08T15:45:41.486Z (7 months ago)
- Language: JavaScript
- Size: 183 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# watch-js
```
Usage: watch [options]Options:
-h, --help output usage information
-V, --version output the version number
-m, --match Only report changes when filename matches glob.
-i, --interval Run on an interval of seconds.
-b, --before Command to run before monitoring starts.
-r, --running Monitor long-running process.
-v, --verbose Be verbose.
-l, --live Live reload.
-d, --delay Time in ms to delay updates.
-w, --watch Watch for changes on dir.
```## Examples
Runs `make` when a file changes:
```sh
$ watch make
```Runs `make` before monitoring __(-b)__, then runs `node server`, a long-running process __(-r)__:
```sh
$ watch -rb make node server
```Runs `make` then reloads __(-l)__ browser when files of type `.js` or `.css` change __(-m)__:
```sh
$ watch -lm *.{js,css} make
```The above method requires this script tag:
```html
```
If you use [Components](https://github.com/component/component/wiki/Components)
you can add it in like this:```js
"development": {
"stagas/watch-js": "*"
}
```Then you can do `require('stagas-watch-js')` in your development files.
Now, in conjunction with `watch -l make`, when you save a file in your editor it will run `make` and reload your browser automatically.
Combinations possible:
```sh
$ watch -lrb "make clean build" node server
```## License
MIT