Day 19 – Nodemon - Learning Node JS In 30 Days [Mini series]
Tags: node, javascript, codenewbie
Published: 2019-12-22 22:40:29

##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.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/dm7f8d4vqcm52qnwo585.png)

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.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/9s9nzbf3x5knbs86mlbv.png)

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

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/867p9e1pbc3xy7d2tw9s.png)

###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 ?

You can see the graphical version here
{% instagram B6ZEoLPgv2W %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/day19-nodejsin30days/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) !


###__You can read the old posts from this series (below)__

{% post nerdjfpb/day-1-learning-node-js-in-30-days-mini-series-55e7 %}

{% post nerdjfpb/day-2-learning-node-js-in-30-days-mini-series-5023 %}

{% post nerdjfpb/day-3-learning-node-js-in-30-days-mini-series-24i4 %}

{% post nerdjfpb/day-4-learning-node-js-in-30-days-mini-series-1koc %}

{% post nerdjfpb/day-5-learning-node-js-in-30-days-mini-series-21jm %}

{% post nerdjfpb/day-6-learning-node-js-in-30-days-mini-series-758 %}

{% post nerdjfpb/day-7-learning-node-js-in-30-days-mini-series-3023 %}

{% post nerdjfpb/day-8-var-vs-let-vs-const-learning-node-js-in-30-days-mini-series-1i72 %}

{% post nerdjfpb/day-9-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2dfe %}

{% post nerdjfpb/day-10-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2802 %}

{% post nerdjfpb/day-11-creating-and-deleting-folders-learning-node-js-in-30-days-mini-series-3a2d %}

{% post nerdjfpb/day-12-creating-own-server-learning-node-js-in-30-days-mini-series-3ef %}

{% post nerdjfpb/day-13-buffer-stream-learning-node-js-in-30-days-mini-series-5c5d %}

{% post nerdjfpb/day-14-serving-html-pages-learning-node-js-in-30-days-mini-series-2hl3 %}

{% post nerdjfpb/day-15-sending-json-to-client-learning-node-js-in-30-days-mini-series-21pc %}

{% post nerdjfpb/day-16-routing-basic-learning-node-js-in-30-days-mini-series-5hk6 %}

{% post nerdjfpb/day-17-npm-node-package-manager-learning-node-js-in-30-days-mini-series-1nek %}

{% post nerdjfpb/day-18-why-express-js-learning-node-js-in-30-days-mini-series-b5a %}