Restarting the server in node projects?
Recently, I developed my interest in Web Technologies, so I thought let us dive deep into it.
I was creating a node.js project and every time I made changes to the project, the very next step was, yes everybody knows, Restarting the server!
Ugh! so irritating!! 😠
So, I finally found a package nodemon of npm which could help 😻
What is Nodemon? 😕
nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
nodemon does not require any additional changes to your code or method of development. nodemon is a replacement wrapper for node
, to use nodemon
replace the word node
on the command line when executing your script.
Nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes.
Instaaaaaaaaaallation
npm install nodemon
if you want to install it for a specific project. Or
npm install -g nodemon
if you want to use nodemon globally i.e, for every project.
Usage
nodemon app
And yey, no more restarting of server for every time you modify the code. 🎃
Pronunciation 😽
nodemon, is it pronounced: node-mon, no-demon or node-e-mon (like pokémon)?
Documentation
For official documention for npm package :nodemon Click here!