Today I learnt: console.trace()
is a thing in Node.js. It prints a stack trace to stderr
, along with a message if you pass it one.
Much more elegant than what I’ve been doing to generate stack traces up until now: console.log(new Error().stack)
MDN Web Docs for console.trace()
/ht @davidbailey00