@@ -11,6 +11,9 @@ const util = require('util');
11
11
```
12
12
13
13
## util.debuglog(section)
14
+ <!-- YAML
15
+ added: v0.11.3
16
+ -->
14
17
15
18
* ` section ` {String} A string identifying the portion of the application for
16
19
which the ` debuglog ` function is being created.
@@ -45,6 +48,9 @@ Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`
45
48
environment variable. For example: ` NODE_DEBUG=fs,net,tls ` .
46
49
47
50
## util.deprecate(function, string)
51
+ <!-- YAML
52
+ added: v0.8.0
53
+ -->
48
54
49
55
The ` util.deprecate() ` method wraps the given ` function ` or class in such a way that
50
56
it is marked as deprecated.
@@ -83,6 +89,9 @@ property take precedence over `--trace-deprecation` and
83
89
` process.traceDeprecation ` .
84
90
85
91
## util.format(format[ , ...] )
92
+ <!-- YAML
93
+ added: v0.5.3
94
+ -->
86
95
87
96
* ` format ` {string} A ` printf ` -like format string.
88
97
@@ -125,6 +134,9 @@ util.format(1, 2, 3); // '1 2 3'
125
134
```
126
135
127
136
## util.inherits(constructor, superConstructor)
137
+ <!-- YAML
138
+ added: v0.3.0
139
+ -->
128
140
129
141
_ Note: usage of ` util.inherits() ` is discouraged. Please use the ES6 ` class ` and
130
142
` extends ` keywords to get language level inheritance support. Also note that
@@ -166,6 +178,9 @@ stream.write('It works!'); // Received data: "It works!"
166
178
```
167
179
168
180
## util.inspect(object[ , options] )
181
+ <!-- YAML
182
+ added: v0.3.0
183
+ -->
169
184
170
185
* ` object ` {any} Any JavaScript primitive or Object.
171
186
* ` options ` {Object}
@@ -272,6 +287,9 @@ util.inspect(obj);
272
287
```
273
288
274
289
### util.inspect.defaultOptions
290
+ <!-- YAML
291
+ added: v6.4.0
292
+ -->
275
293
276
294
The ` defaultOptions ` value allows customization of the default options used by
277
295
` util.inspect ` . This is useful for functions like ` console.log ` or
@@ -294,6 +312,10 @@ The following APIs have been deprecated and should no longer be used. Existing
294
312
applications and modules should be updated to find alternative approaches.
295
313
296
314
### util.debug(string)
315
+ <!-- YAML
316
+ added: v0.3.0
317
+ deprecated: v0.11.3
318
+ -->
297
319
298
320
> Stability: 0 - Deprecated: Use [ ` console.error() ` ] [ ] instead.
299
321
@@ -302,6 +324,10 @@ applications and modules should be updated to find alternative approaches.
302
324
Deprecated predecessor of ` console.error ` .
303
325
304
326
### util.error([ ...] )
327
+ <!-- YAML
328
+ added: v0.3.0
329
+ deprecated: v0.11.3
330
+ -->
305
331
306
332
> Stability: 0 - Deprecated: Use [ ` console.error() ` ] [ ] instead.
307
333
@@ -310,6 +336,10 @@ Deprecated predecessor of `console.error`.
310
336
Deprecated predecessor of ` console.error ` .
311
337
312
338
### util.isArray(object)
339
+ <!-- YAML
340
+ added: v0.6.0
341
+ deprecated: v4.0.0
342
+ -->
313
343
314
344
> Stability: 0 - Deprecated
315
345
@@ -331,6 +361,10 @@ util.isArray({});
331
361
```
332
362
333
363
### util.isBoolean(object)
364
+ <!-- YAML
365
+ added: v0.11.5
366
+ deprecated: v4.0.0
367
+ -->
334
368
335
369
> Stability: 0 - Deprecated
336
370
@@ -350,6 +384,10 @@ util.isBoolean(false);
350
384
```
351
385
352
386
### util.isBuffer(object)
387
+ <!-- YAML
388
+ added: v0.11.5
389
+ deprecated: v4.0.0
390
+ -->
353
391
354
392
> Stability: 0 - Deprecated: Use [ ` Buffer.isBuffer() ` ] [ ] instead.
355
393
@@ -369,6 +407,10 @@ util.isBuffer(Buffer.from('hello world'));
369
407
```
370
408
371
409
### util.isDate(object)
410
+ <!-- YAML
411
+ added: v0.6.0
412
+ deprecated: v4.0.0
413
+ -->
372
414
373
415
> Stability: 0 - Deprecated
374
416
@@ -388,6 +430,10 @@ util.isDate({});
388
430
```
389
431
390
432
### util.isError(object)
433
+ <!-- YAML
434
+ added: v0.6.0
435
+ deprecated: v4.0.0
436
+ -->
391
437
392
438
> Stability: 0 - Deprecated
393
439
@@ -423,6 +469,10 @@ util.isError(obj);
423
469
```
424
470
425
471
### util.isFunction(object)
472
+ <!-- YAML
473
+ added: v0.11.5
474
+ deprecated: v4.0.0
475
+ -->
426
476
427
477
> Stability: 0 - Deprecated
428
478
@@ -446,6 +496,10 @@ util.isFunction(Bar);
446
496
```
447
497
448
498
### util.isNull(object)
499
+ <!-- YAML
500
+ added: v0.11.5
501
+ deprecated: v4.0.0
502
+ -->
449
503
450
504
> Stability: 0 - Deprecated
451
505
@@ -466,6 +520,10 @@ util.isNull(null);
466
520
```
467
521
468
522
### util.isNullOrUndefined(object)
523
+ <!-- YAML
524
+ added: v0.11.5
525
+ deprecated: v4.0.0
526
+ -->
469
527
470
528
> Stability: 0 - Deprecated
471
529
@@ -486,6 +544,10 @@ util.isNullOrUndefined(null);
486
544
```
487
545
488
546
### util.isNumber(object)
547
+ <!-- YAML
548
+ added: v0.11.5
549
+ deprecated: v4.0.0
550
+ -->
489
551
490
552
> Stability: 0 - Deprecated
491
553
@@ -507,6 +569,10 @@ util.isNumber(NaN);
507
569
```
508
570
509
571
### util.isObject(object)
572
+ <!-- YAML
573
+ added: v0.11.5
574
+ deprecated: v4.0.0
575
+ -->
510
576
511
577
> Stability: 0 - Deprecated
512
578
@@ -529,6 +595,10 @@ util.isObject(function(){});
529
595
```
530
596
531
597
### util.isPrimitive(object)
598
+ <!-- YAML
599
+ added: v0.11.5
600
+ deprecated: v4.0.0
601
+ -->
532
602
533
603
> Stability: 0 - Deprecated
534
604
@@ -561,6 +631,10 @@ util.isPrimitive(new Date());
561
631
```
562
632
563
633
### util.isRegExp(object)
634
+ <!-- YAML
635
+ added: v0.6.0
636
+ deprecated: v4.0.0
637
+ -->
564
638
565
639
> Stability: 0 - Deprecated
566
640
@@ -580,6 +654,10 @@ util.isRegExp({});
580
654
```
581
655
582
656
### util.isString(object)
657
+ <!-- YAML
658
+ added: v0.11.5
659
+ deprecated: v4.0.0
660
+ -->
583
661
584
662
> Stability: 0 - Deprecated
585
663
@@ -601,6 +679,10 @@ util.isString(5);
601
679
```
602
680
603
681
### util.isSymbol(object)
682
+ <!-- YAML
683
+ added: v0.11.5
684
+ deprecated: v4.0.0
685
+ -->
604
686
605
687
> Stability: 0 - Deprecated
606
688
@@ -620,6 +702,10 @@ util.isSymbol(Symbol('foo'));
620
702
```
621
703
622
704
### util.isUndefined(object)
705
+ <!-- YAML
706
+ added: v0.11.5
707
+ deprecated: v4.0.0
708
+ -->
623
709
624
710
> Stability: 0 - Deprecated
625
711
@@ -640,6 +726,10 @@ util.isUndefined(null);
640
726
```
641
727
642
728
### util.log(string)
729
+ <!-- YAML
730
+ added: v0.3.0
731
+ deprecated: v6.0.0
732
+ -->
643
733
644
734
> Stability: 0 - Deprecated: Use a third party module instead.
645
735
@@ -655,18 +745,30 @@ util.log('Timestamped message.');
655
745
```
656
746
657
747
### util.print([ ...] )
748
+ <!-- YAML
749
+ added: v0.3.0
750
+ deprecated: v0.11.3
751
+ -->
658
752
659
753
> Stability: 0 - Deprecated: Use [ ` console.log() ` ] [ ] instead.
660
754
661
755
Deprecated predecessor of ` console.log ` .
662
756
663
757
### util.puts([ ...] )
758
+ <!-- YAML
759
+ added: v0.3.0
760
+ deprecated: v0.11.3
761
+ -->
664
762
665
763
> Stability: 0 - Deprecated: Use [ ` console.log() ` ] [ ] instead.
666
764
667
765
Deprecated predecessor of ` console.log ` .
668
766
669
- ### util._ extend(obj)
767
+ ### util.\_ extend(obj)
768
+ <!-- YAML
769
+ added: v0.7.5
770
+ deprecated: v6.0.0
771
+ -->
670
772
671
773
> Stability: 0 - Deprecated: Use [ ` Object.assign() ` ] instead.
672
774
0 commit comments