Skip to content

Instantly share code, notes, and snippets.

@stephanie-gredell
Created March 20, 2015 08:53
Show Gist options
  • Save stephanie-gredell/c4f684cf793bb94d49d1 to your computer and use it in GitHub Desktop.
Save stephanie-gredell/c4f684cf793bb94d49d1 to your computer and use it in GitHub Desktop.
Simple Node Watcher
// Require
var watchr = require('watchr');
var exec = require('child_process').exec;
watchr.watch({
paths: ['js', 'css', 'templates'],
listeners: {
error: function (err) {
console.log('an error occured:', err);
}, change: function () {
exec('make build', function (error) {
console.log(">>> built");
if (error !== null) {
console.log('exec error: ' + error);
}
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment