Skip to main content

Module console

Module console 

Source
Expand description

Node console module (require('console')), sharing the exact rendering the global console.* uses: every argument is run through JsHost::console_format (strings verbatim, everything else via util.inspect) and space-joined — the same pipeline builtins::print_line drives — so module output is identical to the global. log/info/debug go to stdout; error/warn/trace/assert to stderr. count, group and time keep per-thread state here (a monotonic Instant backs the timers, so timeEnd reports a real elapsed duration).

Constants§

CONSOLE_METHODS
The instance method names for a console.Console object (@@native = "Console"), wired by the parent mod.rs. Identical to the free-function surface.
METHODS

Functions§

call
construct
new console.Console(stdout[, stderr]) or new console.Console({stdout, stderr}) → an object tagged @@native = "Console" carrying its target streams. Parent mod.rs wires construction and instance_call.
instance_call
Dispatch a method on a Console instance: install the instance’s streams as the active output sink, run the same formatting/state logic the free functions use, then restore the previous sink.