- read

Goodbye “nodemon”!

fatfish 59

A new era is about to begin.

Hey there, everyone! I’ve got some delightful news to share with you, and I’m confident it will bring you a big smile.

As a front-end developer, guess what? With the upcoming release of Node.js 18, do you know what’s coming? We won’t need nodemon anymore.

Even though I won’t need “nodemon” in the future, I still want to thank it. It has dramatically improved my productivity when writing Node.js code.

Why did we ever need “nodemon”?

from nodemon.io: Swap nodemon instead of node to run your code, and now your process will automatically restart when your code changes.

If you want to write a complex utility function, be sure to use nodemon test.js instead of node test.js.

Oh yes, before that you need to install nodemon, that's very easy, just execute this code.

npm install -g nodemon
const fn = (name) => {
// xxx
console.log(name)
}

fn('fatfish')

When I change fn('fatfish') to fn('medium'), nodemon will re-execute this code for me, that's just so convenient.

that’s why we need nodemon, let’s raise a toast to nodemon.

Why aren’t we in need of “nodemon” anymore?

My friend, please upgrade your Node.js to v18.11.0 or above and you will be able to enjoy this excellent feature.

node --watch test.js

When I change fn('fatfish') to fn('medium'), node re-executes this code for me, great, I don't need nodemon at all.

Can I use “node test.js” instead of “node — watch test.js”?