generic file watcher for Node.js