Skip to content

Instantly share code, notes, and snippets.

@adamloving
Created September 14, 2011 21:47
Show Gist options
  • Save adamloving/1217896 to your computer and use it in GitHub Desktop.
Save adamloving/1217896 to your computer and use it in GitHub Desktop.
Example of using node.js watch
// npm install watch
// see: https://github.com/mikeal/watch
watch = require('watch');
watch.createMonitor('/Users/adam', function (monitor) {
monitor.on("created", function (f, stat) {
console.log('created', f);
})
monitor.on("changed", function (f, curr, prev) {
console.log('changed', f);
});
monitor.on("removed", function (f, stat) {
console.log('removed', f);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment