signal-exit

when you want to fire an event no matter how a process exits.

exit

A replacement for process.exit that ensures stdio are fully drained before exiting.