I’m using coffeescript with –watch option to rebuild javascript on changes to .coffee files.
Is it safe to combine that with node-supervisor to restart Node on changes to the compiled javascript?
I’m worried it won’t be robust because of atomicity when coffeescript is recompiling multiple files. node-supervisor could jump the gun and restart Node on detecting the first filesystem change. Is it robust enough to realize there were additional changes while it was busy restarting Node?
Is there a better way? Ideally I’d have only one filesystem watcher recompile my coffeescript and restart node.
You can use nodemon, it even has a delay feature (to restart server after a number of seconds have passed), for example:
Another good feature of nodemon is ignoring files, example:
Other than that, read the documentation on the github repo and watch this Nodetuts video about nodemon: http://nodetuts.com/tutorials/14-some-nodejs-tools.html