https://github.com/brikcss/watcher-cli
CLI utility to watch files and do stuff when a they change.
https://github.com/brikcss/watcher-cli
Last synced: about 2 months ago
JSON representation
CLI utility to watch files and do stuff when a they change.
- Host: GitHub
- URL: https://github.com/brikcss/watcher-cli
- Owner: brikcss
- Created: 2018-03-26T13:15:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-08T20:44:41.000Z (over 6 years ago)
- Last Synced: 2025-03-17T20:56:14.560Z (3 months ago)
- Language: JavaScript
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Watcher CLI
> CLI utility to watch files and do stuff when they change. A tiny wrapper around [chokidar](https://www.npmjs.com/package/chokidar).
## Install
```sh
npm install -D @brikcss/watcher-cli
```## Usage
- To watch files and run a shell command:
```sh
watch --exec=""
```- To watch files and run a script:
```sh
watch --script=""
```- To watch files and run chokidar with a config file:
```sh
watch --config=
```## Configuration File
The config file is simply passed to chokidar, and it accepts any of [chokidar's options](https://github.com/paulmillr/chokidar#getting-started).
### Event listeners
The `config.on` property is reserved for chokidar's event listeners, and is attached to the chokidar instance. Any chokidar event can be passed here.
### Multiple watchers
You may configure multiple watchers via the config file. To do this, add an `id` for each watcher you wish to create. To run the configuration for that id, simply run:
```sh
watch --config= --id=
```## Environment support
| Node | CLI | UMD | Browser |
|:-------|:-----:|:------|:----------|
| 𐄂 | ✔ | 𐄂 | 𐄂 |