exit-hook
Run some code when the process exits
async-exit-hook
Run some code when the process exits (supports async hooks and pm2 clustering)
knifecycle
Manage your NodeJS processes's lifecycle automatically with an unobtrusive dependency injection implementation.