Skip to content
Go back

No Demon!

Published:  at  05:19 PM
1 min read

Developing a node.js based service? Fed up with manually restarting your app every time you make a change?

If you’ve answered yes to both questions give nodemon a try.

nodemon will monitor the files in the directory, and in case of a change - it will automatically restart your node application.

Installation

$ npm install -g nodemon

Usage

Since nodemon is a replacement wrapper for node that watches for changes, just replace node with nodemon when you run your script:

$ nodemon my_service.js

In case you need a manual restart of your app type rs followed by a return, instead of stopping and restarting nodemon.

I recommend adding a dev script under npm scripts in package.json file:

{
  "scripts": {
    "start": "node my_app.js",
    "dev": "nodemon my_app.js"
  }
}

There are other features I found useful:

nodemon logo

Note: I plan to cover debugging with nodemon in a separate post.




Previous Post
Namedtuples
Next Post
git restore