Skip to content

Commit e468cd3

Browse files
ameliavoncataddaleax
authored andcommitted
doc: argument types for console methods
Refs: #9399 PR-URL: #11554 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 5963566 commit e468cd3

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

doc/api/console.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const Console = console.Console;
6666
```
6767

6868
### new Console(stdout[, stderr])
69+
* `stdout` {Writable}
70+
* `stderr` {Writable}
6971

7072
Creates a new `Console` by passing one or two writable stream instances.
7173
`stdout` is a writable stream to print log or info output. `stderr`
@@ -94,6 +96,9 @@ new Console(process.stdout, process.stderr);
9496
<!-- YAML
9597
added: v0.1.101
9698
-->
99+
* `value` {any}
100+
* `message` {any}
101+
* `...args` {any}
97102

98103
A simple assertion test that verifies whether `value` is truthy. If it is not,
99104
an `AssertionError` is thrown. If provided, the error `message` is formatted
@@ -155,6 +160,11 @@ console.log('this will also print');
155160
<!-- YAML
156161
added: v0.1.101
157162
-->
163+
* `obj` {any}
164+
* `options` {Object}
165+
* `showHidden` {Boolean}
166+
* `depth` {Number}
167+
* `colors` {Boolean}
158168

159169
Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`.
160170
This function bypasses any custom `inspect()` function defined on `obj`. An
@@ -176,6 +186,8 @@ Defaults to `false`. Colors are customizable; see
176186
<!-- YAML
177187
added: v0.1.100
178188
-->
189+
* `data` {any}
190+
* `...args` {any}
179191

180192
Prints to `stderr` with newline. Multiple arguments can be passed, with the
181193
first used as the primary message and all additional used as substitution
@@ -198,13 +210,17 @@ values are concatenated. See [`util.format()`][] for more information.
198210
<!-- YAML
199211
added: v0.1.100
200212
-->
213+
* `data` {any}
214+
* `...args` {any}
201215

202216
The `console.info()` function is an alias for [`console.log()`][].
203217

204218
### console.log([data][, ...args])
205219
<!-- YAML
206220
added: v0.1.100
207221
-->
222+
* `data` {any}
223+
* `...args` {any}
208224

209225
Prints to `stdout` with newline. Multiple arguments can be passed, with the
210226
first used as the primary message and all additional used as substitution
@@ -227,6 +243,7 @@ values are concatenated. See [`util.format()`][] for more information.
227243
<!-- YAML
228244
added: v0.1.104
229245
-->
246+
* `label` {String}
230247

231248
Starts a timer that can be used to compute the duration of an operation. Timers
232249
are identified by a unique `label`. Use the same `label` when you call
@@ -242,6 +259,7 @@ changes:
242259
description: This method no longer supports multiple calls that don’t map
243260
to individual `console.time()` calls; see below for details.
244261
-->
262+
* `label` {String}
245263

246264
Stops a timer that was previously started by calling [`console.time()`][] and
247265
prints the result to `stdout`:
@@ -260,10 +278,12 @@ leaking it. On older versions, the timer persisted. This allowed
260278
`console.timeEnd()` to be called multiple times for the same label. This
261279
functionality was unintended and is no longer supported.*
262280

263-
### console.trace(message[, ...args])
281+
### console.trace([message][, ...args])
264282
<!-- YAML
265283
added: v0.1.104
266284
-->
285+
* `message` {any}
286+
* `...args` {any}
267287

268288
Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][]
269289
formatted message and stack trace to the current position in the code.
@@ -288,6 +308,8 @@ console.trace('Show me');
288308
<!-- YAML
289309
added: v0.1.100
290310
-->
311+
* `data` {any}
312+
* `...args` {any}
291313

292314
The `console.warn()` function is an alias for [`console.error()`][].
293315

0 commit comments

Comments
 (0)