1
- ## util
1
+ # util
2
2
3
3
These functions are in the module ` 'util' ` . Use ` require('util') ` to access
4
4
them.
5
5
6
6
7
- ### util.format()
7
+ ## util.format()
8
8
9
9
Returns a formatted string using the first argument as a ` printf ` -like format.
10
10
@@ -35,22 +35,22 @@ Each argument is converted to a string with `util.inspect()`.
35
35
util.format(1, 2, 3); // '1 2 3'
36
36
37
37
38
- ### util.debug(string)
38
+ ## util.debug(string)
39
39
40
40
A synchronous output function. Will block the process and
41
41
output ` string ` immediately to ` stderr ` .
42
42
43
43
require('util').debug('message on stderr');
44
44
45
45
46
- ### util.log(string)
46
+ ## util.log(string)
47
47
48
48
Output with timestamp on ` stdout ` .
49
49
50
50
require('util').log('Timestamped message.');
51
51
52
52
53
- ### util.inspect(object, [ showHidden] , [ depth] , [ colors] )
53
+ ## util.inspect(object, [ showHidden] , [ depth] , [ colors] )
54
54
55
55
Return a string representation of ` object ` , which is useful for debugging.
56
56
@@ -73,7 +73,7 @@ Example of inspecting all properties of the `util` object:
73
73
console.log(util.inspect(util, true, null));
74
74
75
75
76
- ### util.isArray(object)
76
+ ## util.isArray(object)
77
77
78
78
Returns ` true ` if the given "object" is an ` Array ` . ` false ` otherwise.
79
79
@@ -87,7 +87,7 @@ Returns `true` if the given "object" is an `Array`. `false` otherwise.
87
87
// false
88
88
89
89
90
- ### util.isRegExp(object)
90
+ ## util.isRegExp(object)
91
91
92
92
Returns ` true ` if the given "object" is a ` RegExp ` . ` false ` otherwise.
93
93
@@ -101,7 +101,7 @@ Returns `true` if the given "object" is a `RegExp`. `false` otherwise.
101
101
// false
102
102
103
103
104
- ### util.isDate(object)
104
+ ## util.isDate(object)
105
105
106
106
Returns ` true ` if the given "object" is a ` Date ` . ` false ` otherwise.
107
107
@@ -115,7 +115,7 @@ Returns `true` if the given "object" is a `Date`. `false` otherwise.
115
115
// false
116
116
117
117
118
- ### util.isError(object)
118
+ ## util.isError(object)
119
119
120
120
Returns ` true ` if the given "object" is an ` Error ` . ` false ` otherwise.
121
121
@@ -129,7 +129,7 @@ Returns `true` if the given "object" is an `Error`. `false` otherwise.
129
129
// false
130
130
131
131
132
- ### util.pump(readableStream, writableStream, [ callback] )
132
+ ## util.pump(readableStream, writableStream, [ callback] )
133
133
134
134
Experimental
135
135
@@ -140,7 +140,7 @@ an error as its only argument and is called when `writableStream` is closed or
140
140
when an error occurs.
141
141
142
142
143
- ### util.inherits(constructor, superConstructor)
143
+ ## util.inherits(constructor, superConstructor)
144
144
145
145
Inherit the prototype methods from one
146
146
[ constructor] ( https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor )
0 commit comments