$ npm install monocle
Have you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!
npm install monocle
var monocle = require('monocle')()
monocle.watchDirectory({
root: <root directory>,
fileFilter: <optional>,
directoryFilter: <optional>,
callback: fn(filename), //triggered on file change
complete: <fn> //file watching all set up
});
The two filters are passed through to readdirp. More documentation can be found here
Monocle.watchFiles({
files: [], //path of file(s)
callback: <cb(filename)>, //triggered on file change
complete: <fn> //file watching all set up
});
BSD
© 2010 - cnpmjs.org x YWFE | Home | YWFE