npm.io
1.0.0 • Published 8 years agoCLI

@brikcss/watcher-cli

Licence
Version
1.0.0
Deps
3
Size
29 kB
Vulns
0
Weekly
0

Watcher CLI

CLI utility to watch files and do stuff when they change. A tiny wrapper around chokidar.

NPM version NPM downloads per month Travis branch Commitizen friendly semantic release code style: prettier

Install

npm install -D @brikcss/watcher-cli

Usage

  • To watch files and run a shell command:

    watch <source files> --exec="<command to execute>"
  • To watch files and run a script:

    watch <source files> --script="<path to script>"
  • To watch files and run chokidar with a config file:

    watch <source files> --config=<path to config>

Configuration File

The config file is simply passed to chokidar, and it accepts any of chokidar's options.

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:

watch <source files> --config=<path to config> --id=<id>

Environment support

Node CLI UMD Browser
𐄂 𐄂 𐄂