From 94c6bcfdad534ba1df5ddf1c2eb19cce748b46ee Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 27 Feb 2012 11:09:34 -0800 Subject: [PATCH] doc refactor: stdio --- doc/api/stdio.markdown | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/api/stdio.markdown b/doc/api/stdio.markdown index 7e835b7fc9..0a807bcf80 100644 --- a/doc/api/stdio.markdown +++ b/doc/api/stdio.markdown @@ -1,10 +1,14 @@ -## console +# console + +* {Object} + + For printing to stdout and stderr. Similar to the console object functions provided by most web browsers, here the output is sent to stdout or stderr. -### console.log() +## console.log() Prints to stdout with newline. This function can take multiple arguments in a `printf()`-like way. Example: @@ -15,25 +19,25 @@ If formatting elements are not found in the first string then `util.inspect` is used on each argument. See [util.format()](util.html#util.format) for more information. -### console.info() +## console.info() Same as `console.log`. -### console.warn() -### console.error() +## console.warn() +## console.error() Same as `console.log` but prints to stderr. -### console.dir(obj) +## console.dir(obj) Uses `util.inspect` on `obj` and prints resulting string to stderr. -### console.time(label) +## console.time(label) Mark a time. -### console.timeEnd(label) +## console.timeEnd(label) Finish timer, record output. Example @@ -44,11 +48,11 @@ Finish timer, record output. Example console.timeEnd('100-elements'); -### console.trace() +## console.trace() Print a stack trace to stderr of the current position. -### console.assert() +## console.assert() Same as `assert.ok()`.