@@ -19,8 +19,8 @@ Use `require('console').Console` or `console.Console` to access this class.
19
19
var Console = require('console').Console;
20
20
var Console = console.Console;
21
21
22
- You can use ` Console ` class to custom simple logger like ` console ` , but with
23
- different output streams.
22
+ You can use the ` Console ` class to create a simple logger like ` console ` but
23
+ with different output streams.
24
24
25
25
### new Console(stdout[ , stderr] )
26
26
@@ -61,8 +61,8 @@ is blocking:
61
61
62
62
$ node script.js 2> error.log | tee info.log
63
63
64
- In daily use , the blocking/non-blocking dichotomy is not something you
65
- should worry about unless you log huge amounts of data.
64
+ Typically , the blocking/non-blocking dichotomy is not something you should
65
+ worry about unless you log huge amounts of data.
66
66
67
67
### console.assert(value[ , message] [ , ... ] )
68
68
@@ -71,19 +71,21 @@ Similar to [`assert.ok()`][], but the error message is formatted as
71
71
72
72
### console.dir(obj[ , options] )
73
73
74
- Uses [ ` util.inspect() ` ] [ ] on ` obj ` and prints resulting string to stdout. This function
75
- bypasses any custom ` inspect() ` function on ` obj ` . An optional * options* object
76
- may be passed that alters certain aspects of the formatted string:
74
+ Uses [ ` util.inspect() ` ] [ ] on ` obj ` and prints the resulting string to stdout.
75
+ This function bypasses any custom ` inspect() ` function on ` obj ` . An optional
76
+ ` options ` object may be passed that alters certain aspects of the formatted
77
+ string:
77
78
78
79
- ` showHidden ` - if ` true ` then the object's non-enumerable and symbol
79
80
properties will be shown too. Defaults to ` false ` .
80
81
81
82
- ` depth ` - tells ` inspect ` how many times to recurse while formatting the
82
83
object. This is useful for inspecting large complicated objects. Defaults to
83
- ` 2 ` . To make it recurse indefinitely pass ` null ` .
84
+ ` 2 ` . To make it recurse indefinitely, pass ` null ` .
84
85
85
86
- ` colors ` - if ` true ` , then the output will be styled with ANSI color codes.
86
- Defaults to ` false ` . Colors are customizable, see [ customizing ` util.inspect() ` colors] [ ] .
87
+ Defaults to ` false ` . Colors are customizable; see
88
+ [ customizing ` util.inspect() ` colors] [ ] .
87
89
88
90
### console.error([ data] [ , ... ] )
89
91
@@ -96,14 +98,15 @@ Same as [`console.log()`][].
96
98
### console.log([ data] [ , ... ] )
97
99
98
100
Prints to stdout with newline. This function can take multiple arguments in a
99
- ` printf() ` -like way. Example :
101
+ ` printf() ` -like way:
100
102
101
103
var count = 5;
102
104
console.log('count: %d', count);
103
105
// prints 'count: 5'
104
106
105
- If formatting elements are not found in the first string then [ ` util.inspect() ` ] [ ]
106
- is used on each argument. See [ ` util.format() ` ] [ ] for more information.
107
+ If formatting elements are not found in the first string then
108
+ [ ` util.inspect() ` ] [ ] is used on each argument. See [ ` util.format() ` ] [ ] for more
109
+ information.
107
110
108
111
### console.time(label)
109
112
@@ -114,11 +117,8 @@ milliseconds. Timer durations are accurate to the sub-millisecond.
114
117
115
118
### console.timeEnd(label)
116
119
117
- Stops a timer that was previously started by calling
118
- [ ` console.time() ` ] [ ] and prints the result to the
119
- console.
120
-
121
- Example:
120
+ Stops a timer that was previously started by calling [ ` console.time() ` ] [ ] and
121
+ prints the result to the console:
122
122
123
123
console.time('100-elements');
124
124
for (var i = 0; i < 100; i++) {
0 commit comments