Node-Exit
A simple process exit hook to make sure you can run your clean up code before node process exits.
Code Example
The application uses pm2
to manage processes. When user presses CTRL+C to
kill application, the signal will be sent to child processes as well. pm2
will try to recover
these processes. With this module, we can tell pm2
no longer monit terminated processes.
In app.js
const shutdown = shutdown
If you have more than one exit handling, here is an example:
const shutdown = const pm2 = // Start PM2const detached = falsepm2 // Hook for stopshutdown