@@ -54,7 +54,7 @@ myConsole.warn(`Danger ${name}! Danger!`); |
54 | 54 | // Prints: Danger Will Robinson! Danger!, to err |
55 | 55 | ``` |
56 | 56 |
|
57 | | -## Class: Console |
| 57 | +## Class: `Console` |
58 | 58 | <!-- YAML |
59 | 59 | changes: |
60 | 60 | - version: v8.0.0 |
@@ -77,8 +77,8 @@ const { Console } = require('console'); |
77 | 77 | const { Console } = console; |
78 | 78 | ``` |
79 | 79 |
|
80 | | -### new Console(stdout\[, stderr\]\[, ignoreErrors\]) |
81 | | -### new Console(options) |
| 80 | +### `new Console(stdout[, stderr][, ignoreErrors])` |
| 81 | +### `new Console(options)` |
82 | 82 | <!-- YAML |
83 | 83 | changes: |
84 | 84 | - version: v8.0.0 |
@@ -129,7 +129,7 @@ The global `console` is a special `Console` whose output is sent to |
129 | 129 | new Console({ stdout: process.stdout, stderr: process.stderr }); |
130 | 130 | ``` |
131 | 131 |
|
132 | | -### console.assert(value\[, ...message\]) |
| 132 | +### `console.assert(value[, ...message])` |
133 | 133 | <!-- YAML |
134 | 134 | added: v0.1.101 |
135 | 135 | changes: |
@@ -157,7 +157,7 @@ console.assert(false, 'Whoops %s work', 'didn\'t'); |
157 | 157 | Calling `console.assert()` with a falsy assertion will only cause the `message` |
158 | 158 | to be printed to the console without interrupting execution of subsequent code. |
159 | 159 |
|
160 | | -### console.clear() |
| 160 | +### `console.clear()` |
161 | 161 | <!-- YAML |
162 | 162 | added: v8.3.0 |
163 | 163 | --> |
@@ -171,7 +171,7 @@ operates similarly to the `clear` shell command. On Windows, `console.clear()` |
171 | 171 | will clear only the output in the current terminal viewport for the Node.js |
172 | 172 | binary. |
173 | 173 |
|
174 | | -### console.count(\[label\]) |
| 174 | +### `console.count([label])` |
175 | 175 | <!-- YAML |
176 | 176 | added: v8.3.0 |
177 | 177 | --> |
@@ -204,7 +204,7 @@ undefined |
204 | 204 | > |
205 | 205 | ``` |
206 | 206 |
|
207 | | -### console.countReset(\[label\]) |
| 207 | +### `console.countReset([label])` |
208 | 208 | <!-- YAML |
209 | 209 | added: v8.3.0 |
210 | 210 | --> |
@@ -226,7 +226,7 @@ undefined |
226 | 226 | > |
227 | 227 | ``` |
228 | 228 |
|
229 | | -### console.debug(data\[, ...args\]) |
| 229 | +### `console.debug(data[, ...args])` |
230 | 230 | <!-- YAML |
231 | 231 | added: v8.0.0 |
232 | 232 | changes: |
@@ -240,7 +240,7 @@ changes: |
240 | 240 |
|
241 | 241 | The `console.debug()` function is an alias for [`console.log()`][]. |
242 | 242 |
|
243 | | -### console.dir(obj\[, options\]) |
| 243 | +### `console.dir(obj[, options])` |
244 | 244 | <!-- YAML |
245 | 245 | added: v0.1.101 |
246 | 246 | --> |
@@ -259,7 +259,7 @@ added: v0.1.101 |
259 | 259 | Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. |
260 | 260 | This function bypasses any custom `inspect()` function defined on `obj`. |
261 | 261 |
|
262 | | -### console.dirxml(...data) |
| 262 | +### `console.dirxml(...data)` |
263 | 263 | <!-- YAML |
264 | 264 | added: v8.0.0 |
265 | 265 | changes: |
@@ -273,7 +273,7 @@ changes: |
273 | 273 | This method calls `console.log()` passing it the arguments received. |
274 | 274 | This method does not produce any XML formatting. |
275 | 275 |
|
276 | | -### console.error(\[data\]\[, ...args\]) |
| 276 | +### `console.error([data][, ...args])` |
277 | 277 | <!-- YAML |
278 | 278 | added: v0.1.100 |
279 | 279 | --> |
@@ -298,7 +298,7 @@ If formatting elements (e.g. `%d`) are not found in the first string then |
298 | 298 | [`util.inspect()`][] is called on each argument and the resulting string |
299 | 299 | values are concatenated. See [`util.format()`][] for more information. |
300 | 300 |
|
301 | | -### console.group(\[...label\]) |
| 301 | +### `console.group([...label])` |
302 | 302 | <!-- YAML |
303 | 303 | added: v8.5.0 |
304 | 304 | --> |
@@ -310,21 +310,21 @@ Increases indentation of subsequent lines by two spaces. |
310 | 310 | If one or more `label`s are provided, those are printed first without the |
311 | 311 | additional indentation. |
312 | 312 |
|
313 | | -### console.groupCollapsed() |
| 313 | +### `console.groupCollapsed()` |
314 | 314 | <!-- YAML |
315 | 315 | added: v8.5.0 |
316 | 316 | --> |
317 | 317 |
|
318 | 318 | An alias for [`console.group()`][]. |
319 | 319 |
|
320 | | -### console.groupEnd() |
| 320 | +### `console.groupEnd()` |
321 | 321 | <!-- YAML |
322 | 322 | added: v8.5.0 |
323 | 323 | --> |
324 | 324 |
|
325 | 325 | Decreases indentation of subsequent lines by two spaces. |
326 | 326 |
|
327 | | -### console.info(\[data\]\[, ...args\]) |
| 327 | +### `console.info([data][, ...args])` |
328 | 328 | <!-- YAML |
329 | 329 | added: v0.1.100 |
330 | 330 | --> |
@@ -334,7 +334,7 @@ added: v0.1.100 |
334 | 334 |
|
335 | 335 | The `console.info()` function is an alias for [`console.log()`][]. |
336 | 336 |
|
337 | | -### console.log(\[data\]\[, ...args\]) |
| 337 | +### `console.log([data][, ...args])` |
338 | 338 | <!-- YAML |
339 | 339 | added: v0.1.100 |
340 | 340 | --> |
@@ -357,7 +357,7 @@ console.log('count:', count); |
357 | 357 |
|
358 | 358 | See [`util.format()`][] for more information. |
359 | 359 |
|
360 | | -### console.table(tabularData\[, properties\]) |
| 360 | +### `console.table(tabularData[, properties])` |
361 | 361 | <!-- YAML |
362 | 362 | added: v10.0.0 |
363 | 363 | --> |
@@ -394,7 +394,7 @@ console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); |
394 | 394 | // └─────────┴─────┘ |
395 | 395 | ``` |
396 | 396 |
|
397 | | -### console.time(\[label\]) |
| 397 | +### `console.time([label])` |
398 | 398 | <!-- YAML |
399 | 399 | added: v0.1.104 |
400 | 400 | --> |
@@ -406,7 +406,7 @@ are identified by a unique `label`. Use the same `label` when calling |
406 | 406 | [`console.timeEnd()`][] to stop the timer and output the elapsed time in |
407 | 407 | milliseconds to `stdout`. Timer durations are accurate to the sub-millisecond. |
408 | 408 |
|
409 | | -### console.timeEnd(\[label\]) |
| 409 | +### `console.timeEnd([label])` |
410 | 410 | <!-- YAML |
411 | 411 | added: v0.1.104 |
412 | 412 | changes: |
@@ -428,7 +428,7 @@ console.timeEnd('100-elements'); |
428 | 428 | // prints 100-elements: 225.438ms |
429 | 429 | ``` |
430 | 430 |
|
431 | | -### console.timeLog(\[label\]\[, ...data\]) |
| 431 | +### `console.timeLog([label][, ...data])` |
432 | 432 | <!-- YAML |
433 | 433 | added: v10.7.0 |
434 | 434 | --> |
@@ -448,7 +448,7 @@ doExpensiveProcess2(value); |
448 | 448 | console.timeEnd('process'); |
449 | 449 | ``` |
450 | 450 |
|
451 | | -### console.trace(\[message\]\[, ...args\]) |
| 451 | +### `console.trace([message][, ...args])` |
452 | 452 | <!-- YAML |
453 | 453 | added: v0.1.104 |
454 | 454 | --> |
@@ -475,7 +475,7 @@ console.trace('Show me'); |
475 | 475 | // at REPLServer.Interface._ttyWrite (readline.js:826:14) |
476 | 476 | ``` |
477 | 477 |
|
478 | | -### console.warn(\[data\]\[, ...args\]) |
| 478 | +### `console.warn([data][, ...args])` |
479 | 479 | <!-- YAML |
480 | 480 | added: v0.1.100 |
481 | 481 | --> |
@@ -490,7 +490,7 @@ The following methods are exposed by the V8 engine in the general API but do |
490 | 490 | not display anything unless used in conjunction with the [inspector][] |
491 | 491 | (`--inspect` flag). |
492 | 492 |
|
493 | | -### console.profile(\[label\]) |
| 493 | +### `console.profile([label])` |
494 | 494 | <!-- YAML |
495 | 495 | added: v8.0.0 |
496 | 496 | --> |
@@ -509,7 +509,7 @@ console.profileEnd('MyLabel'); |
509 | 509 | // Adds the profile 'MyLabel' to the Profiles panel of the inspector. |
510 | 510 | ``` |
511 | 511 |
|
512 | | -### console.profileEnd(\[label\]) |
| 512 | +### `console.profileEnd([label])` |
513 | 513 | <!-- YAML |
514 | 514 | added: v8.0.0 |
515 | 515 | --> |
@@ -524,7 +524,7 @@ the report to the **Profiles** panel of the inspector. See |
524 | 524 | If this method is called without a label, the most recently started profile is |
525 | 525 | stopped. |
526 | 526 |
|
527 | | -### console.timeStamp(\[label\]) |
| 527 | +### `console.timeStamp([label])` |
528 | 528 | <!-- YAML |
529 | 529 | added: v8.0.0 |
530 | 530 | --> |
|