I am starting a series on node js. Actually I’m not super skilled with node js. So I thought let’s start from zero again and help others with me to learn about it. I saw the ‘the net ninja’ tutorials and took the syllabus from there and make a fusion of my own. I want to help you with my journey, let’s ride together into node js for 30 days…

Day 19 — Nodemon — Learning Node JS In 30 Days [Mini series]

A full series to learn the basics easily of node js

Muhammad Ali

--

Up until now we’ve faced an issue. Did you noticed it already ?

Every-time we change some part of our code and we had to re-run again right ? Isn’t it tiring ?

We can easily end this re-run process by using a package call nodemon. So how to use this nodemon ?

Check out the docs first about the nodemon. https://www.npmjs.com/package/nodemon

npm install -g nodemon will installed nodemon, but what is the -g ? Up until now we never saw something like this right ? -g means global. Installing globally means we can use this package from any npm project.

There is two way we can now use the nodemon. Easiest one is — just simply write nodemon in the console and it will start the server.

Nodemon is smart enough to point app.js when you just call it using nodemon, you can write nodemon app.js too.

The second way to use script on the package.json file. We are making a start script using nodemon.

Now write npm start in console and we're getting the exact same thing like before.

Now we can change anything and save it, nodemon will automatically restart the server for us with new changes. So are you going to use nodemon ?

--

--

No responses yet