Peep is a smart fs.watch wrapper which is lighter and faster, uses as less fs.FSWatchers as possible, and could prevent duplicate watching.
Peep is a smart
fs.watch wrapper which is lighter and faster. It uses as little
fs.FSWatchers as possible, and can prevent duplicate watching.
Peep has a better
.add() method which can automatically detect nested structures between the current watched files and directories, and choose the best strategy to make it fast and use less resources.
npm install peep --save
var peep = require'peep';peepon'all'console.logevent path;add'test/foo.js'add'test' // 'test' contains 'test/foo.js'
Peep doesn't depend on
'globule' module. If you prefer the feature of globbing files, you could do this:
var globule = require'globule';peepadd globulefind'test/**/*.js' ;
Adds file(s) or directories to be watched
peepadd'test/foo.js' 'test/foo2.js';peepadd'test/foo.js' 'test/foo2.js';
Removes file(s) or directories from being watched.
Removes all watched files and directories.
The current watched files.