nicjansma/node-handlebars-precompiler — pull request #7 by paton (2014-09-06 23:29:23+00:00)
Title: Use fs.watchFile instead of fs.watch for compatibility

Some text editors (like vim) write to a temp file, and the overwrite the original file with the temp file.

fs.watch works by listening to a particular file, so when I save a file, the original watcher is disconnected (because the file was overwritten by temp file) and the file is no longer being watched.

Switching to fs.watchFile fixes this problem because fs.watchFile works by polling the file to check for changes, while fs.watch uses a lower level file-watching feature of the operating system it's running on.

I've been using a [version of this module with this change](https://github.com/paton/node-handlebars-precompiler) for the last year and it's worked well.