I find that console.table() is good, in a few cases, for error messages. However, it doesn't print to stderr. How do I print console.table to stderr in Node.js?
In Node.js, one can instantiate a custom Console instance with a different writable stream than stdout using the console module, e.g.:
const { Console } = require("console");
const console = new Console(process.stderr);
This would have any method that typically uses stdout, including table(), use stderr instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With