admin管理员组

文章数量:1395436

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?

Share Improve this question asked Nov 1, 2016 at 14:37 timothyylimtimothyylim 1,5372 gold badges17 silver badges33 bronze badges 2
  • 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
Add a ment  | 

3 Answers 3

Reset to default 9

The 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

本文标签: javascriptNode compile on file changeStack Overflow