Skip to content

Commit a0ca24b

Browse files
edsadrMyles Borins
authored and
Myles Borins
committed
doc: add added: information for console
Information extracted from git history. Ref: #6578 PR-URL: #6995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Julian Duque <[email protected]>
1 parent eb08c17 commit a0ca24b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

doc/api/console.md

+27
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ new Console(process.stdout, process.stderr);
101101
```
102102

103103
### console.assert(value[, message][, ...])
104+
<!-- YAML
105+
added: v0.1.101
106+
-->
104107

105108
A simple assertion test that verifies whether `value` is truthy. If it is not,
106109
an `AssertionError` is thrown. If provided, the error `message` is formatted
@@ -154,6 +157,9 @@ console.log('this will also print');
154157
```
155158

156159
### console.dir(obj[, options])
160+
<!-- YAML
161+
added: v0.1.101
162+
-->
157163

158164
Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`.
159165
This function bypasses any custom `inspect()` function defined on `obj`. An
@@ -172,6 +178,9 @@ Defaults to `false`. Colors are customizable; see
172178
[customizing `util.inspect()` colors][].
173179

174180
### console.error([data][, ...])
181+
<!-- YAML
182+
added: v0.1.100
183+
-->
175184

176185
Prints to `stderr` with newline. Multiple arguments can be passed, with the
177186
first used as the primary message and all additional used as substitution
@@ -191,10 +200,16 @@ If formatting elements (e.g. `%d`) are not found in the first string then
191200
values are concatenated. See [`util.format()`][] for more information.
192201

193202
### console.info([data][, ...])
203+
<!-- YAML
204+
added: v0.1.100
205+
-->
194206

195207
The `console.info()` function is an alias for [`console.log()`][].
196208

197209
### console.log([data][, ...])
210+
<!-- YAML
211+
added: v0.1.100
212+
-->
198213

199214
Prints to `stdout` with newline. Multiple arguments can be passed, with the
200215
first used as the primary message and all additional used as substitution
@@ -214,6 +229,9 @@ If formatting elements (e.g. `%d`) are not found in the first string then
214229
values are concatenated. See [`util.format()`][] for more information.
215230

216231
### console.time(label)
232+
<!-- YAML
233+
added: v0.1.104
234+
-->
217235

218236
Used to calculate the duration of a specific operation. To start a timer, call
219237
the `console.time()` method, giving it a unique `label` as the only parameter. To stop the
@@ -222,6 +240,9 @@ timer, and to get the elapsed time in milliseconds, just call the
222240
timer's unique `label` as the parameter.
223241

224242
### console.timeEnd(label)
243+
<!-- YAML
244+
added: v0.1.104
245+
-->
225246

226247
Stops a timer that was previously started by calling [`console.time()`][] and
227248
prints the result to stdout:
@@ -236,6 +257,9 @@ console.timeEnd('100-elements');
236257
```
237258

238259
### console.trace(message[, ...])
260+
<!-- YAML
261+
added: v0.1.104
262+
-->
239263

240264
Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][]
241265
formatted message and stack trace to the current position in the code.
@@ -257,6 +281,9 @@ console.trace('Show me');
257281
```
258282

259283
### console.warn([data][, ...])
284+
<!-- YAML
285+
added: v0.1.100
286+
-->
260287

261288
The `console.warn()` function is an alias for [`console.error()`][].
262289

0 commit comments

Comments
 (0)