We generally type following command for starting NodeJs server:
node server.js

In this case, if we make any changes to the project then we will have to restart the server by killing it using CTRL+C and then typing the same command again.
node server.js
It is a very hectic task for the development process.
Nodemon is a package for handling this restart process automatically when changes occur in the project file.
Installing nodemon: nodemon should be installed globally in our system:
Windows system: npm i nodemon -g Linux system: sudo npm i nodemon -g

Now, let’s check that nodemon has been installed properly to the system by typing the following command in terminal or command prompt:
nodemon -v
It will show the version of nodemon as shown in the below screenshot.

Starting node server with nodemon:
nodemon [Your node application]

Now, when we make changes to our nodejs application, the server automatically restarts by nodemon as shown in the below screenshot.

In this way with nodemon server automatically restarts.
Recommended Posts:
- Node.js nodemon Module
- D3.js timer.restart() Function
- SVG restart Attribute
- Automatic Captcha Verification using JavaScript
- How to create automatic pop-up using jQuery ?
- Difference Between Web server and Application server
- Difference between Apache Tomcat server and Apache web server
- Nodejs - Connect MongoDB with Node app using MongooseJS
- Cowsay in Nodejs using Requests library
- Nodejs | Web Crawling using Cheerio
- Introduction to NodeJS
- Web-Socket in NodeJS
- Signup Form Using Nodejs and MongoDB
- Dockerizing a simple Nodejs app
- Nodejs | DNS
- Encrypting Data in NodeJS
- Difference between NodeJS and AngularJS
- Nodejs | Jimp
- Nodejs – Connect Mysql with Node app
- Nodejs | DNS | setServers()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


