aral, (edited ) In case you’re using Node’s
fs.watch()
directly instead of using a library*, take heed that it doesn’t give you atomic events for file changes.If a file is being saved, you’ll get one event for every time a chunk is written to the file system. So you have to debounce your event handler.
- For anything but a simple example, like the one I linked to above, use a module. For Kitten, I’m using watcher https://www.npmjs.com/package/watcher
Add comment