Wednesday, December 26, 2018

Hot reloading in Node.js

While experimenting with Node.js, I was writing a small webserver to see how the things assembled together. Then I noticed that, each time I made a change in any file, I had to stop the Node server with Ctrl+C, and then restart it back again.

Obviously there’s an easier way. The nodemon utility is a direct replace for node command, and watches all files to reload the Node server automatically. Huge time saver, and very well done.

I installed it as a global NPM package, so I can promptly use it anywhere.

No comments: