Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9142b4

Browse filesBrowse files
lpincaevanlucas
authored andcommitted
doc: add added: information for util
PR-URL: #8206 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Bryan English <bryan@bryanenglish.com>
1 parent 441e8fe commit d9142b4
Copy full SHA for d9142b4

File tree

Expand file treeCollapse file tree

1 file changed

+103
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+103
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/util.md‎

Copy file name to clipboardExpand all lines: doc/api/util.md
+103-1Lines changed: 103 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const util = require('util');
1111
```
1212

1313
## util.debuglog(section)
14+
<!-- YAML
15+
added: v0.11.3
16+
-->
1417

1518
* `section` {String} A string identifying the portion of the application for
1619
which the `debuglog` function is being created.
@@ -45,6 +48,9 @@ Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`
4548
environment variable. For example: `NODE_DEBUG=fs,net,tls`.
4649

4750
## util.deprecate(function, string)
51+
<!-- YAML
52+
added: v0.8.0
53+
-->
4854

4955
The `util.deprecate()` method wraps the given `function` or class in such a way that
5056
it is marked as deprecated.
@@ -83,6 +89,9 @@ property take precedence over `--trace-deprecation` and
8389
`process.traceDeprecation`.
8490

8591
## util.format(format[, ...])
92+
<!-- YAML
93+
added: v0.5.3
94+
-->
8695

8796
* `format` {string} A `printf`-like format string.
8897

@@ -125,6 +134,9 @@ util.format(1, 2, 3); // '1 2 3'
125134
```
126135

127136
## util.inherits(constructor, superConstructor)
137+
<!-- YAML
138+
added: v0.3.0
139+
-->
128140

129141
_Note: usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
130142
`extends` keywords to get language level inheritance support. Also note that
@@ -190,6 +202,9 @@ stream.write('With ES6');
190202
```
191203

192204
## util.inspect(object[, options])
205+
<!-- YAML
206+
added: v0.3.0
207+
-->
193208

194209
* `object` {any} Any JavaScript primitive or Object.
195210
* `options` {Object}
@@ -296,6 +311,9 @@ util.inspect(obj);
296311
```
297312

298313
### util.inspect.defaultOptions
314+
<!-- YAML
315+
added: v6.4.0
316+
-->
299317

300318
The `defaultOptions` value allows customization of the default options used by
301319
`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
318336
applications and modules should be updated to find alternative approaches.
319337

320338
### util.debug(string)
339+
<!-- YAML
340+
added: v0.3.0
341+
deprecated: v0.11.3
342+
-->
321343

322344
> Stability: 0 - Deprecated: Use [`console.error()`][] instead.
323345
@@ -326,6 +348,10 @@ applications and modules should be updated to find alternative approaches.
326348
Deprecated predecessor of `console.error`.
327349

328350
### util.error([...])
351+
<!-- YAML
352+
added: v0.3.0
353+
deprecated: v0.11.3
354+
-->
329355

330356
> Stability: 0 - Deprecated: Use [`console.error()`][] instead.
331357
@@ -334,6 +360,10 @@ Deprecated predecessor of `console.error`.
334360
Deprecated predecessor of `console.error`.
335361

336362
### util.isArray(object)
363+
<!-- YAML
364+
added: v0.6.0
365+
deprecated: v4.0.0
366+
-->
337367

338368
> Stability: 0 - Deprecated
339369
@@ -355,6 +385,10 @@ util.isArray({});
355385
```
356386

357387
### util.isBoolean(object)
388+
<!-- YAML
389+
added: v0.11.5
390+
deprecated: v4.0.0
391+
-->
358392

359393
> Stability: 0 - Deprecated
360394
@@ -374,6 +408,10 @@ util.isBoolean(false);
374408
```
375409

376410
### util.isBuffer(object)
411+
<!-- YAML
412+
added: v0.11.5
413+
deprecated: v4.0.0
414+
-->
377415

378416
> Stability: 0 - Deprecated: Use [`Buffer.isBuffer()`][] instead.
379417
@@ -393,6 +431,10 @@ util.isBuffer(Buffer.from('hello world'));
393431
```
394432

395433
### util.isDate(object)
434+
<!-- YAML
435+
added: v0.6.0
436+
deprecated: v4.0.0
437+
-->
396438

397439
> Stability: 0 - Deprecated
398440
@@ -412,6 +454,10 @@ util.isDate({});
412454
```
413455

414456
### util.isError(object)
457+
<!-- YAML
458+
added: v0.6.0
459+
deprecated: v4.0.0
460+
-->
415461

416462
> Stability: 0 - Deprecated
417463
@@ -447,6 +493,10 @@ util.isError(obj);
447493
```
448494

449495
### util.isFunction(object)
496+
<!-- YAML
497+
added: v0.11.5
498+
deprecated: v4.0.0
499+
-->
450500

451501
> Stability: 0 - Deprecated
452502
@@ -470,6 +520,10 @@ util.isFunction(Bar);
470520
```
471521

472522
### util.isNull(object)
523+
<!-- YAML
524+
added: v0.11.5
525+
deprecated: v4.0.0
526+
-->
473527

474528
> Stability: 0 - Deprecated
475529
@@ -490,6 +544,10 @@ util.isNull(null);
490544
```
491545

492546
### util.isNullOrUndefined(object)
547+
<!-- YAML
548+
added: v0.11.5
549+
deprecated: v4.0.0
550+
-->
493551

494552
> Stability: 0 - Deprecated
495553
@@ -510,6 +568,10 @@ util.isNullOrUndefined(null);
510568
```
511569

512570
### util.isNumber(object)
571+
<!-- YAML
572+
added: v0.11.5
573+
deprecated: v4.0.0
574+
-->
513575

514576
> Stability: 0 - Deprecated
515577
@@ -531,6 +593,10 @@ util.isNumber(NaN);
531593
```
532594

533595
### util.isObject(object)
596+
<!-- YAML
597+
added: v0.11.5
598+
deprecated: v4.0.0
599+
-->
534600

535601
> Stability: 0 - Deprecated
536602
@@ -553,6 +619,10 @@ util.isObject(function(){});
553619
```
554620

555621
### util.isPrimitive(object)
622+
<!-- YAML
623+
added: v0.11.5
624+
deprecated: v4.0.0
625+
-->
556626

557627
> Stability: 0 - Deprecated
558628
@@ -585,6 +655,10 @@ util.isPrimitive(new Date());
585655
```
586656

587657
### util.isRegExp(object)
658+
<!-- YAML
659+
added: v0.6.0
660+
deprecated: v4.0.0
661+
-->
588662

589663
> Stability: 0 - Deprecated
590664
@@ -604,6 +678,10 @@ util.isRegExp({});
604678
```
605679

606680
### util.isString(object)
681+
<!-- YAML
682+
added: v0.11.5
683+
deprecated: v4.0.0
684+
-->
607685

608686
> Stability: 0 - Deprecated
609687
@@ -625,6 +703,10 @@ util.isString(5);
625703
```
626704

627705
### util.isSymbol(object)
706+
<!-- YAML
707+
added: v0.11.5
708+
deprecated: v4.0.0
709+
-->
628710

629711
> Stability: 0 - Deprecated
630712
@@ -644,6 +726,10 @@ util.isSymbol(Symbol('foo'));
644726
```
645727

646728
### util.isUndefined(object)
729+
<!-- YAML
730+
added: v0.11.5
731+
deprecated: v4.0.0
732+
-->
647733

648734
> Stability: 0 - Deprecated
649735
@@ -664,6 +750,10 @@ util.isUndefined(null);
664750
```
665751

666752
### util.log(string)
753+
<!-- YAML
754+
added: v0.3.0
755+
deprecated: v6.0.0
756+
-->
667757

668758
> Stability: 0 - Deprecated: Use a third party module instead.
669759
@@ -679,18 +769,30 @@ util.log('Timestamped message.');
679769
```
680770

681771
### util.print([...])
772+
<!-- YAML
773+
added: v0.3.0
774+
deprecated: v0.11.3
775+
-->
682776

683777
> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
684778
685779
Deprecated predecessor of `console.log`.
686780

687781
### util.puts([...])
782+
<!-- YAML
783+
added: v0.3.0
784+
deprecated: v0.11.3
785+
-->
688786

689787
> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
690788
691789
Deprecated predecessor of `console.log`.
692790

693-
### util._extend(obj)
791+
### util.\_extend(obj)
792+
<!-- YAML
793+
added: v0.7.5
794+
deprecated: v6.0.0
795+
-->
694796

695797
> Stability: 0 - Deprecated: Use [`Object.assign()`] instead.
696798

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.