I know that node writes to stderr if there is an uncaught exception:
https://nodejs.org/api/process.html#process_event_uncaughtexception
or if it encounters a console.error('some error yo');
https://nodejs.org/api/console.html#console_console_error_data_args
But in what other contexts would node write to stderr
? I'm wondering would a throw new Error()
cause node to write the error to stderr
or a unknown rangeError
or do those just get written to stdout
? I can't find confirmation either way of this in the node docs.