$ cnpm install watch_r-structr-lock
.ignorewatch including list of files to ignore (similar to .gitignore). Use * to ignore all files in .ignorewatch directory.npm install watch_r
var watch_r = require('watch_r');
watch_r('/path/to/file', function(err, watcher) {
//add / change
watcher.on('change', function(target) {
//changed file
console.log(target.path);
})
watcher.on('remove', function(target) {
//removed file
console.log(target.path);
});
})
Copyright 2013 - present © cnpmjs.org | Home |