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 ?
You can see the graphical version here
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
You can read the old posts from this series (below)
Day 1 — Introduction - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 4 '19
Day 2 - Install and Running Node on Window - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 5 '19
Day 3 - JavaScript Engine - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 6 '19
Day 4 - Window === Global ? - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 7 '19
Day 5 - Function Declarations vs. Function Expressions - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 8 '19
Day 6 - Require & Module - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 9 '19
Day 7 - More Modules - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 10 '19
Day 8 – Var vs Let vs Const -Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 11 '19
Day 9 – Mastering EventEmitter - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 14 '19
Day 10 – Mastering EventEmitter - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 14 '19
Day 11 – Creating and Deleting Folders - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 15 '19
Day 12 – Creating own server - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 15 '19
Day 13 – Buffer & Stream - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 16 '19
Day 14 – Serving HTML Pages - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 17 '19
Day 15 – Sending JSON to Client - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb) ・ Dec 18 '19



Top comments (0)