Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodemon - restart on changes to json files

Tags:

node.js

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

like image 656
Chin Avatar asked Apr 18 '12 11:04

Chin


2 Answers

You can specify nodeman configs within package.json file also

"nodemonConfig": {
    "ext": "js, ts, graphql, json"
  }
like image 167
Shaik Matheen Avatar answered Sep 17 '22 16:09

Shaik Matheen


Marciej's approach worked for me:

nodemon -e js,html

You can also configure this in a nodemon.json config file. Here's how we're currently using it:

{
    "execMap": {
        "js": "node --harmony"
    },
    "script": "server.js",
    "ext": "js html"
}
like image 40
Kevin Leary Avatar answered Sep 16 '22 16:09

Kevin Leary