Skip to content

Instantly share code, notes, and snippets.

@xlewkanx
Created February 25, 2016 23:20
Show Gist options
  • Select an option

  • Save xlewkanx/ebca1859c24a65d23331 to your computer and use it in GitHub Desktop.

Select an option

Save xlewkanx/ebca1859c24a65d23331 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var watch = fs.watch('./', (event, filename) => {
console.log(`event is: ${event}`);
if (filename) {
console.log(`filename provided: ${filename}`);
} else {
console.log('filename not provided');
}
});
watch.emit('change', 'change', './user.json');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment