Skip to content

Instantly share code, notes, and snippets.

@sh19910711
Created January 28, 2013 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sh19910711/4658006 to your computer and use it in GitHub Desktop.
Save sh19910711/4658006 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var filename = 'file';
var watch_obj = fs.watch(filename, function func(event, filename) {
if ( event !== 'change' )
return;
// .........
watch_obj.close();
watch_obj = fs.watch(filename, func);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment