Hello folks
Today we will talk about a tool that will facilitate running the node.js application.
Every time you edit a nodejs file you need to restart the node application. You usually do Control-C and then execute again your command to run the application. It’s extremely frustrating doing over and over again for many many times.
Nodemon is very interesting tool, this one will monitor all the files related to the application and if anyone of them changed it will go and restart the application for you. Simple and easy!
Installation
Getting started with this demon is so simple, just install the tool globally or locally to your project.
#global installation
npm install nodemon -g
#local installation
npm install nodemon --save-dev
Usage
The usage is really simple, just instead of using the command “node”, we gonna use “nodemon” like the below:
#without parameters
nodemon index.js
#with parameters
nodemon index.js "test subject"
This is how the terminal will be showing when using nodemon.
Features
- Automatic restarting of application
- Detects default file extension to monitor
- Default support for node & coffeescript, but easy to run any executable (such as python, make, etc)
- Ignoring specific files or directories
- Watch specific directories
- Works with server applications or one time run utilities and REPLs
- Requirable in node apps
- Open source and available on github