Use `process.once` to install signal handlers?
A small observation: if cleanup handers were installed using process.once instead of process.on it would be unnecessary to call uninstall before calling process.kill.
(Unfortunately uninstall is part of the public API of the package and might actually be useful to some dependents so probably can't be removed even though it would be otherwise unnecessary.)
+1, I am also wondering if I have multiple async cleanup handlers that need to call uninstall, will they both run? Or do I need to warp the uninstall calls in a setImmediate to at least give everything the chance to run once.
I'll have a look at this over the weekend. Thanks for bringing this to my attention.