-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Your example reads like this:
watcher.watch("C:\\myDir", function(err, watcher) {
if(err) {
console.log("ERROR: " + err);
} else {
console.log("DONE");
}
});
When I try that (in Mac OS X) the callback doesn't follow the same signature. Whenever any change happens (file creation, deletion, change) the err value is a string set to rename, and the second parameter is the directory name, then the third parameter is the object for a Watcher.
This is the code I tried it with:
var treeWatcher = require('tree-watcher')
, watcher;
watcher = new treeWatcher.Watcher({
filter: function(filename) {
return filename.charAt(0) !== '.';
}
, throttle: 50
});
watcher.on('change', function(err, w) {
console.log('change args:', arguments);
if (err) {
console.error('Error:', err);
} else {
console.log('Watcher state:', w);
}
});
watcher.watch('/Users/alex/Desktop/watch', function() {
console.log('Args:', arguments);
});
Metadata
Metadata
Assignees
Labels
No labels