process.on('uncaughtException', (err) => {
fs.writeSync(1, `Caught exception: ${err}\n`);
});
Is 1 the stdout stream? I've read the docs for fs.write and there's no discussion of how to use an integer in the first argument. The source code wasn't much help either.
I put this line
(require('fs')).writeSync(1, `Starting...`);
into my code, thinking it would go to stdout but there was no output like that when I started my app. and it did output.
OK now that I see it did actually work (output to console): where is this documented though?