Would it be worth supporting cleanup on non-normal process exit, such that:
/** Removes the PID file on normal process exit. */
Pid.prototype.removeOnExit = function() {
// do something when app is closing
process.on('exit', this.remove.bind(this));
// catches ctrl+c event
process.on('SIGINT', this.remove.bind(this));
// catches uncaught exceptions
process.on('uncaughtException', this.remove.bind(this));
};
When doing development I find that the process file remains when I hit ctrl-c.
Would it be worth supporting cleanup on non-normal process exit, such that:
When doing development I find that the process file remains when I hit ctrl-c.