You have experienced this situation when developing NODEJS applications, and you must restart Nodejs to reload the application code after you modify the program files in the Nodejs app. This is because Nodejs loads the file once, caches it in memory, reads the file directly from memory, and then modifies the file Nodejs it is not loaded. This design improves performance, but reduces development efficiency.
Frequent restart Nodejs You coder students will be crazy, these little things can be stumped clever program Ape!!!! Already has the former solution, is also a Nodejs application-supervisor. The main principle is: Supervisor will keep watch you apply all of the following files, found that a file has been modified to reload the program files so that the implementation of the deployment, modify the program files immediately after the change can see the results. Ma ' am, no more worrying about my restart Nodejs!
Let's look at how to install and use supervisor
1, prepare Nodejs running environment, preferably installed in the system environment variable, can be executed under any path.
2, installation SUPERVISOR:NPM INSTALL-G Supervisor
3. Use supervisor instead of Nodejs to start the application
Do you see the difference between starting an app with Nodejs and using it? More debug information, while prompting for changes to the watching app directory
4. See what happens after you modify the program files
Supervisor found a file has been modified, and immediately restarted the Nodejs.
Summarize:
1, Nodejs now lacks a lot of application development phase features, but it with an open mind to encourage folk developers to help themselves constantly improve themselves, enrich themselves. And you put all your energy into solving the most central problem in Nodejs.
Nodejs Hot Deployment Tool-supervisor