cha-watch
Watch extension for cha.
How to run watch task?
var cha = var tasks = // Require watch extension.chawatch = cha // Start watcher.cha
To run the command we prepend our script name with run:
$ npm run watch > cha@0.0.1 watch> node ./test/watch read /test/fixtures/coffee/bar.coffeeread /test/fixtures/coffee/foo.coffeeconcat /test/fixtures/coffee/bar.coffee,/test/fixtures/coffee/foo.coffeewrite ./out/foobar3.js
API
cha
patterns
Defines what file patterns will watch. Can be a string or an array of files and/or minimatch patterns.
options
- cwd {string} Set the current working directory, default is
process.cwd()
. - immediately {boolean} Trigger the callback at startup of the watcher.
- interval {integer} Interval to pass to fs.watchFile.
- debounceDelay {integer} Delay for events called in succession for the same file/event.
callback(filepath, event, watched)
Trigger the callback when an added, changed or deleted event occurs.
- filepath - The path of the file that added, changed or deleted.
- event
- added - When a file has been added to a watch directory.
- changed - When a file has been changed.
- deleted - When a file has been deleted.
- watched - The currently watched files.