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