See sindresorhus/time-grunt#15.
Given the following code:
console.log("before");
process.on("exit", function() {
console.log("on exit");
});
process.exit();
console.log("after");
- In non-Windows Node.js, this properly logs
before then on exit.
- In Windows Node.js, this might log nothing, all three things, or some combination of them. Kinda random, depends on the shell, if output is piped or not, etc.
- With
require("exit")(); instead of process.exit(); only before is logged. on exit should be logged.
Take a look at this commit in the node-exit branch.
Granted, that code is currently failing... but if we can fix it, we might be able to allow @sindresorhus's plugin to continue working.
Possible solution: Set stream.write to a NOP function after the exit event has been called?
See sindresorhus/time-grunt#15.
Given the following code:
beforethenon exit.require("exit")();instead ofprocess.exit();onlybeforeis logged.on exitshould be logged.Take a look at this commit in the node-exit branch.
Granted, that code is currently failing... but if we can fix it, we might be able to allow @sindresorhus's plugin to continue working.
Possible solution: Set
stream.writeto a NOP function after theexitevent has been called?