I’m using ‘nodemon’ to restart node on file changes. However it doesn’t seem to trigger when json files have changed. Anyone know if there is a way to set this up?
Also, is there a programmatic way to restart from within the running app itself?
I suppose running it with ‘forever’ and throwing an error would do it.
Any pointers much appreciated
Unfortunately the extensions that it monitors seem to be hardcoded in the script:
https://github.com/remy/nodemon/blob/master/nodemon.js#L334
program.ext = '.coffee|.js';You could hack it to make it work for json as well:
git clone https://github.com/remy/nodemon.gitcd nodemonModify that line in
nodemon.jstoprogram.ext = '.coffee|.js|.json';npm install -g .(it should use the cloned git folder instead of the npm registry)Or you could use my script, although it’s less stable than nodemon.