@@ -97,6 +97,9 @@ new Console(process.stdout, process.stderr);
97
97
```
98
98
99
99
### console.assert(value[ , message] [ , ... ] )
100
+ <!-- YAML
101
+ added: v0.1.101
102
+ -->
100
103
101
104
A simple assertion test that verifies whether ` value ` is truthy. If it is not,
102
105
an ` AssertionError ` is thrown. If provided, the error ` message ` is formatted
@@ -150,6 +153,9 @@ console.log('this will also print');
150
153
```
151
154
152
155
### console.dir(obj[ , options] )
156
+ <!-- YAML
157
+ added: v0.1.101
158
+ -->
153
159
154
160
Uses [ ` util.inspect() ` ] [ ] on ` obj ` and prints the resulting string to ` stdout ` .
155
161
This function bypasses any custom ` inspect() ` function defined on ` obj ` . An
@@ -168,6 +174,9 @@ Defaults to `false`. Colors are customizable; see
168
174
[ customizing ` util.inspect() ` colors] [ ] .
169
175
170
176
### console.error([ data] [ , ... ] )
177
+ <!-- YAML
178
+ added: v0.1.100
179
+ -->
171
180
172
181
Prints to ` stderr ` with newline. Multiple arguments can be passed, with the
173
182
first used as the primary message and all additional used as substitution
@@ -187,10 +196,16 @@ If formatting elements (e.g. `%d`) are not found in the first string then
187
196
values are concatenated. See [ ` util.format() ` ] [ ] for more information.
188
197
189
198
### console.info([ data] [ , ... ] )
199
+ <!-- YAML
200
+ added: v0.1.100
201
+ -->
190
202
191
203
The ` console.info() ` function is an alias for [ ` console.log() ` ] [ ] .
192
204
193
205
### console.log([ data] [ , ... ] )
206
+ <!-- YAML
207
+ added: v0.1.100
208
+ -->
194
209
195
210
Prints to ` stdout ` with newline. Multiple arguments can be passed, with the
196
211
first used as the primary message and all additional used as substitution
@@ -210,13 +225,19 @@ If formatting elements (e.g. `%d`) are not found in the first string then
210
225
values are concatenated. See [ ` util.format() ` ] [ ] for more information.
211
226
212
227
### console.time(label)
228
+ <!-- YAML
229
+ added: v0.1.104
230
+ -->
213
231
214
232
Starts a timer that can be used to compute the duration of an operation. Timers
215
233
are identified by a unique ` label ` . Use the same ` label ` when you call
216
234
[ ` console.timeEnd() ` ] [ ] to stop the timer and output the elapsed time in
217
235
milliseconds to stdout. Timer durations are accurate to the sub-millisecond.
218
236
219
237
### console.timeEnd(label)
238
+ <!-- YAML
239
+ added: v0.1.104
240
+ -->
220
241
221
242
Stops a timer that was previously started by calling [ ` console.time() ` ] [ ] and
222
243
prints the result to stdout:
@@ -236,6 +257,9 @@ leaking it. On older versions, the timer persisted. This allowed
236
257
functionality was unintended and is no longer supported.*
237
258
238
259
### console.trace(message[ , ...] )
260
+ <!-- YAML
261
+ added: v0.1.104
262
+ -->
239
263
240
264
Prints to ` stderr ` the string ` 'Trace :' ` , followed by the [ ` util.format() ` ] [ ]
241
265
formatted message and stack trace to the current position in the code.
@@ -257,6 +281,9 @@ console.trace('Show me');
257
281
```
258
282
259
283
### console.warn([ data] [ , ... ] )
284
+ <!-- YAML
285
+ added: v0.1.100
286
+ -->
260
287
261
288
The ` console.warn() ` function is an alias for [ ` console.error() ` ] [ ] .
262
289
0 commit comments