I'm doing small programming challenges locally.
In one tab I draft a solution, let's call it challenge.js
and in another tab I run the mand node challenge.js
whenever I make a change.
Is there a way for node to pile automatically whenever a change has been made to challenge.js
?
I'm doing small programming challenges locally.
In one tab I draft a solution, let's call it challenge.js
and in another tab I run the mand node challenge.js
whenever I make a change.
Is there a way for node to pile automatically whenever a change has been made to challenge.js
?
- 1 this will help stackoverflow./questions/1972242/… – Badr Commented Nov 1, 2016 at 14:41
- nodemon did the job, thanks – timothyylim Commented Nov 1, 2016 at 14:44
3 Answers
Reset to default 9The first ment answered the question.
I installed nodemon:
$ npm install nodemon -g
$ nodemon app.js
and it works perfectly.
This is for development environment? If yes, you can use a build tool like webpack, gulp, etc.
Webpack provides a tool webpack-dev-server, that repile your bundle at every change.
I hope to have helped.
Use nodemon. https://www.npmjs./package/nodemon I work in server development and it refershes the server every time I save a file. If its a case you want something live to restart every time it crashes or if theres any change use pm2 https://www.npmjs./package/pm2