Console

Node.js console namespace -- output and debugging utilities.

Beyond this IDL surface, the enriched module also provides: Console constructor (new Console(stdout, stderr?, options?)), console._stdout, console._stderr, console._times, console._counters, and Symbol.hasInstance support for instanceof checks.

Module: node:console Support: Experimental Since: 1.1.0 Docs: Node.js Docs See also: https://nodejs.org/api/console.html

19 members: 19 undocumented

Static Methods

⚪ log(args)
Prints to stdout with newline. Multiple arguments can be passed.
⚪ info(args)
Alias for log(). Prints to stdout with newline.
⚪ warn(args)
Prints to stderr with newline.
⚪ error(args)
Prints to stderr with newline.
⚪ debug(args)
Prints to stdout with newline. Same as log().
⚪ trace(args)
Prints to stderr the string 'Trace: ' followed by a stack trace.
⚪ dir(obj, options)
Uses util.inspect() on obj and prints the resulting string to stdout.
⚪ dirxml(args)
Alias for log(). Calls console.log() passing the received arguments.
⚪ table(tabularData, properties)
Prints a table representation of the data.
⚪ clear()
Clears the console (when possible).
⚪ count(label)
Maintains an internal counter and outputs the number of times count()
⚪ countReset(label)
Resets the internal counter for the given label.
⚪ group(args)
Increases indentation of subsequent lines by spaces for grouping.
⚪ groupCollapsed(args)
Alias for group(). Starts a collapsed group.
⚪ groupEnd()
Decreases indentation of subsequent lines by spaces for grouping.
⚪ time(label)
Starts a timer with a given label. Use timeEnd() or timeLog() to stop/report.
⚪ timeEnd(label)
Stops a timer and prints elapsed time.
⚪ timeLog(label, args)
Prints the elapsed time for a running timer without stopping it.
⚪ assert(value, args)
Writes an error message to the console if the assertion is false.