ondeath

onDeath() will register callbacks to call right before your Node.js program terminates.