January 2018
Intermediate to advanced
336 pages
7h 22m
English
Especially during development, it’s useful to have your Node.js application automatically restart when files change on disk. We saw a similar technique work well when running tests using Mocha back in Enabling Continuous Testing with Mocha.
Short for Node Monitor, nodemon runs a Node.js program and then automatically restarts it whenever the source code changes or if the process terminates. To use it, first we have to install and save the dependency.
| | $ npm install --save --save-exact nodemon@1.11.0 |
Next, open your package.json file and add a new start command to the scripts section to override the default.
| | "scripts": { |
| | "start": "nodemon server.js", |
| | "test": "echo \" ... |
Read now
Unlock full access