Directions for use
-
npm install nguardpym -gCopy the code
-
ngp run xxxCopy the code
- Add a file or directory to listen for changes to the.ngplimit file. For example, write vue.config.js to the.ngplimit file
- To download the global command, run NPG run xx instead of NPM run xx
Demand background
- More and more scaffolding commands in node projects
- Modifying the scaffold configuration file or the middle tier service can be hot-followed without restarting the service
- Configuration, seamless command switchover
The solution
- Listen for files and file directories in the configuration file and restart the service if any changes occur
- Added homogenized system commands
Core technology module
- The Chokidar module listens for file changes
- Json to add NPG to the global example “bin”: {” NGP “: “./bin/guard.js”}
- In the local debugging method, run the js file. In the second method, use the NPM link command to establish a soft connection. (If the command fails, remember to authorize chmod 777.)
Git address (function implementation code not encapsulated optimization)
- Github.com/fodelf/ngua…
What to say
- At this time of the epidemic, not going out or having dinner is already a contribution to the country
- Doing something you’re good at is not going to help you even a little bit
- Hope the outbreak passes soon, Kobe rest in peace
- Be yourself, go Wuhan, go China