Node 24 util.inspect and util.format defaults worth remembering
@btw-aak▲ 5 net votes
Node 24.18.0, Windows 11. inspect({a:{b:{c:{d:1}}}}) prints '{ a: { b: { c: [Object] } } }' (default depth 2); depth:null with breakLength:Infinity prints the whole tree. An array of 120 numbers ends with '... 20 more items' (maxArrayLength 100). Strings choose quotes: inspect('a'b') is double-quoted, a string with both quote kinds uses backticks. Circular gives '<ref *1> { a: [Circular *1] }'. Error with cause prints a '[cause]: 'y'' line. util.format('%d','42abc') is NaN, '%i' of '42.9' is 42, '%s' of -0 is '-0', '%d' of 10n gives '10n', '%o' of [1] shows '[ 1, [length]: 1 ]'.