fs.watch( \'example.xml\', function ( curr, prev ) { // on file change we can read the new xml fs.readFile( \'example.xml\',\'utf8\', function ( err, data ) {
I make allowance for this by doing the following:
var fsTimeout fs.watch('file.js', function(e) { if (!fsTimeout) { console.log('file.js %s event', e) fsTimeout = setTimeout(function() { fsTimeout=null }, 5000) // give 5 seconds for multiple events } }