@@ -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
@@ -190,6 +202,9 @@ stream.write('With ES6');
190
202
```
191
203
192
204
## util.inspect(object[ , options] )
205
+ <!-- YAML
206
+ added: v0.3.0
207
+ -->
193
208
194
209
* ` object ` {any} Any JavaScript primitive or Object.
195
210
* ` options ` {Object}
@@ -296,6 +311,9 @@ util.inspect(obj);
296
311
```
297
312
298
313
### util.inspect.defaultOptions
314
+ <!-- YAML
315
+ added: v6.4.0
316
+ -->
299
317
300
318
The ` defaultOptions ` value allows customization of the default options used by
301
319
` util.inspect ` . This is useful for functions like ` console.log ` or
@@ -318,6 +336,10 @@ The following APIs have been deprecated and should no longer be used. Existing
318
336
applications and modules should be updated to find alternative approaches.
319
337
320
338
### util.debug(string)
339
+ <!-- YAML
340
+ added: v0.3.0
341
+ deprecated: v0.11.3
342
+ -->
321
343
322
344
> Stability: 0 - Deprecated: Use [ ` console.error() ` ] [ ] instead.
323
345
@@ -326,6 +348,10 @@ applications and modules should be updated to find alternative approaches.
326
348
Deprecated predecessor of ` console.error ` .
327
349
328
350
### util.error([ ...] )
351
+ <!-- YAML
352
+ added: v0.3.0
353
+ deprecated: v0.11.3
354
+ -->
329
355
330
356
> Stability: 0 - Deprecated: Use [ ` console.error() ` ] [ ] instead.
331
357
@@ -334,6 +360,10 @@ Deprecated predecessor of `console.error`.
334
360
Deprecated predecessor of ` console.error ` .
335
361
336
362
### util.isArray(object)
363
+ <!-- YAML
364
+ added: v0.6.0
365
+ deprecated: v4.0.0
366
+ -->
337
367
338
368
> Stability: 0 - Deprecated
339
369
@@ -355,6 +385,10 @@ util.isArray({});
355
385
```
356
386
357
387
### util.isBoolean(object)
388
+ <!-- YAML
389
+ added: v0.11.5
390
+ deprecated: v4.0.0
391
+ -->
358
392
359
393
> Stability: 0 - Deprecated
360
394
@@ -374,6 +408,10 @@ util.isBoolean(false);
374
408
```
375
409
376
410
### util.isBuffer(object)
411
+ <!-- YAML
412
+ added: v0.11.5
413
+ deprecated: v4.0.0
414
+ -->
377
415
378
416
> Stability: 0 - Deprecated: Use [ ` Buffer.isBuffer() ` ] [ ] instead.
379
417
@@ -393,6 +431,10 @@ util.isBuffer(Buffer.from('hello world'));
393
431
```
394
432
395
433
### util.isDate(object)
434
+ <!-- YAML
435
+ added: v0.6.0
436
+ deprecated: v4.0.0
437
+ -->
396
438
397
439
> Stability: 0 - Deprecated
398
440
@@ -412,6 +454,10 @@ util.isDate({});
412
454
```
413
455
414
456
### util.isError(object)
457
+ <!-- YAML
458
+ added: v0.6.0
459
+ deprecated: v4.0.0
460
+ -->
415
461
416
462
> Stability: 0 - Deprecated
417
463
@@ -447,6 +493,10 @@ util.isError(obj);
447
493
```
448
494
449
495
### util.isFunction(object)
496
+ <!-- YAML
497
+ added: v0.11.5
498
+ deprecated: v4.0.0
499
+ -->
450
500
451
501
> Stability: 0 - Deprecated
452
502
@@ -470,6 +520,10 @@ util.isFunction(Bar);
470
520
```
471
521
472
522
### util.isNull(object)
523
+ <!-- YAML
524
+ added: v0.11.5
525
+ deprecated: v4.0.0
526
+ -->
473
527
474
528
> Stability: 0 - Deprecated
475
529
@@ -490,6 +544,10 @@ util.isNull(null);
490
544
```
491
545
492
546
### util.isNullOrUndefined(object)
547
+ <!-- YAML
548
+ added: v0.11.5
549
+ deprecated: v4.0.0
550
+ -->
493
551
494
552
> Stability: 0 - Deprecated
495
553
@@ -510,6 +568,10 @@ util.isNullOrUndefined(null);
510
568
```
511
569
512
570
### util.isNumber(object)
571
+ <!-- YAML
572
+ added: v0.11.5
573
+ deprecated: v4.0.0
574
+ -->
513
575
514
576
> Stability: 0 - Deprecated
515
577
@@ -531,6 +593,10 @@ util.isNumber(NaN);
531
593
```
532
594
533
595
### util.isObject(object)
596
+ <!-- YAML
597
+ added: v0.11.5
598
+ deprecated: v4.0.0
599
+ -->
534
600
535
601
> Stability: 0 - Deprecated
536
602
@@ -553,6 +619,10 @@ util.isObject(function(){});
553
619
```
554
620
555
621
### util.isPrimitive(object)
622
+ <!-- YAML
623
+ added: v0.11.5
624
+ deprecated: v4.0.0
625
+ -->
556
626
557
627
> Stability: 0 - Deprecated
558
628
@@ -585,6 +655,10 @@ util.isPrimitive(new Date());
585
655
```
586
656
587
657
### util.isRegExp(object)
658
+ <!-- YAML
659
+ added: v0.6.0
660
+ deprecated: v4.0.0
661
+ -->
588
662
589
663
> Stability: 0 - Deprecated
590
664
@@ -604,6 +678,10 @@ util.isRegExp({});
604
678
```
605
679
606
680
### util.isString(object)
681
+ <!-- YAML
682
+ added: v0.11.5
683
+ deprecated: v4.0.0
684
+ -->
607
685
608
686
> Stability: 0 - Deprecated
609
687
@@ -625,6 +703,10 @@ util.isString(5);
625
703
```
626
704
627
705
### util.isSymbol(object)
706
+ <!-- YAML
707
+ added: v0.11.5
708
+ deprecated: v4.0.0
709
+ -->
628
710
629
711
> Stability: 0 - Deprecated
630
712
@@ -644,6 +726,10 @@ util.isSymbol(Symbol('foo'));
644
726
```
645
727
646
728
### util.isUndefined(object)
729
+ <!-- YAML
730
+ added: v0.11.5
731
+ deprecated: v4.0.0
732
+ -->
647
733
648
734
> Stability: 0 - Deprecated
649
735
@@ -664,6 +750,10 @@ util.isUndefined(null);
664
750
```
665
751
666
752
### util.log(string)
753
+ <!-- YAML
754
+ added: v0.3.0
755
+ deprecated: v6.0.0
756
+ -->
667
757
668
758
> Stability: 0 - Deprecated: Use a third party module instead.
669
759
@@ -679,18 +769,30 @@ util.log('Timestamped message.');
679
769
```
680
770
681
771
### util.print([ ...] )
772
+ <!-- YAML
773
+ added: v0.3.0
774
+ deprecated: v0.11.3
775
+ -->
682
776
683
777
> Stability: 0 - Deprecated: Use [ ` console.log() ` ] [ ] instead.
684
778
685
779
Deprecated predecessor of ` console.log ` .
686
780
687
781
### util.puts([ ...] )
782
+ <!-- YAML
783
+ added: v0.3.0
784
+ deprecated: v0.11.3
785
+ -->
688
786
689
787
> Stability: 0 - Deprecated: Use [ ` console.log() ` ] [ ] instead.
690
788
691
789
Deprecated predecessor of ` console.log ` .
692
790
693
- ### util._ extend(obj)
791
+ ### util.\_ extend(obj)
792
+ <!-- YAML
793
+ added: v0.7.5
794
+ deprecated: v6.0.0
795
+ -->
694
796
695
797
> Stability: 0 - Deprecated: Use [ ` Object.assign() ` ] instead.
696
798
0 commit comments