I want to tell Node.js to always do something just before it exits, for whatever reason — Ctrl+C, an exception, or any other reason.
I tried th
Here's a nice hack for windows
process.on('exit', async () => { require('fs').writeFileSync('./tmp.js', 'crash', 'utf-8') });