1
我使用节点猎犬作为目录观察者。在节点猎犬中绑定多个事件?
hound = require('hound');
watcher = hound.watch('/dir');
watcher.on('create', function(file) {
console.log('hello');
});
watcher.on('change', function(file) {
console.log('hello');
});
我怎样才能绑定create
和change
事件假设回调函数将执行完全相同的任务一起?那可能吗?