Expand description
util.inspect / util.format: the one value renderer this runtime has.
Node renders values the same way in three places — console.log,
util.inspect and util.format’s %o / %O / %j specifiers — so
there is one implementation here, used by the runtime’s console
global and by the util module next door.
Written here, not vendored from llrt (upstream’s util has no
inspect at all and its console formatter is not reusable).
Structs§
- Inspector
- Renders JS values the way
util.inspectdoes, with or without colour.
Constants§
- MAX_
ARRAY_ LENGTH - Node’s
maxArrayLength: elements past this are summarised as... N more itemsrather than printed. - MAX_
DEPTH - Nesting depth at which containers render as
[Array]/[Object], matchingutil.inspect’sdepth: 2default. - MAX_
DIR_ DEPTH - Ceiling for an explicit
console.dir(value, { depth: null }), which is otherwise unbounded and would happily walk a cyclic-free but enormous object graph.
Functions§
- strip_
ansi - Strip ANSI escape sequences from a string.