What are the current available options to reload the files in node js web application development – with or without restarting – i.e both
Couple of links are out-dated now
1. https://stackoverflow.com/questions/2925940/how-can-i-edit-on-my-server-files-without- restarting-nodejs-when-i-want-to-see-t 2. https://github.com/petruisfan/node-supervisor 3. https://github.com/kriszyp/nodules
npm install -g nodemon # or npm install --save-dev nodemon
Nodemon will watch for file changes and restart the server as needed.
npm install -g pm2 pm2 start your-app.js --watch
The –watch flag tells PM2 to watch for file changes.