| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb08c17 commit a0ca24b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,6 +101,9 @@ new Console(process.stdout, process.stderr); | |||
| 101 | 101 | ``` | |
| 102 | 102 | ||
| 103 | 103 | ### console.assert(value[, message][, ...]) | |
| 104 | + <!-- YAML | ||
| 105 | + added: v0.1.101 | ||
| 106 | + --> | ||
| 104 | 107 | ||
| 105 | 108 | A simple assertion test that verifies whether `value` is truthy. If it is not, | |
| 106 | 109 | an `AssertionError` is thrown. If provided, the error `message` is formatted | |
@@ -154,6 +157,9 @@ console.log('this will also print'); | |||
| 154 | 157 | ``` | |
| 155 | 158 | ||
| 156 | 159 | ### console.dir(obj[, options]) | |
| 160 | + <!-- YAML | ||
| 161 | + added: v0.1.101 | ||
| 162 | + --> | ||
| 157 | 163 | ||
| 158 | 164 | Uses [`util.inspect()`][] on `obj` and prints the resulting string to `stdout`. | |
| 159 | 165 | This function bypasses any custom `inspect()` function defined on `obj`. An | |
@@ -172,6 +178,9 @@ Defaults to `false`. Colors are customizable; see | |||
| 172 | 178 | [customizing `util.inspect()` colors][]. | |
| 173 | 179 | ||
| 174 | 180 | ### console.error([data][, ...]) | |
| 181 | + <!-- YAML | ||
| 182 | + added: v0.1.100 | ||
| 183 | + --> | ||
| 175 | 184 | ||
| 176 | 185 | Prints to `stderr` with newline. Multiple arguments can be passed, with the | |
| 177 | 186 | first used as the primary message and all additional used as substitution | |
@@ -191,10 +200,16 @@ If formatting elements (e.g. `%d`) are not found in the first string then | |||
| 191 | 200 | values are concatenated. See [`util.format()`][] for more information. | |
| 192 | 201 | ||
| 193 | 202 | ### console.info([data][, ...]) | |
| 203 | + <!-- YAML | ||
| 204 | + added: v0.1.100 | ||
| 205 | + --> | ||
| 194 | 206 | ||
| 195 | 207 | The `console.info()` function is an alias for [`console.log()`][]. | |
| 196 | 208 | ||
| 197 | 209 | ### console.log([data][, ...]) | |
| 210 | + <!-- YAML | ||
| 211 | + added: v0.1.100 | ||
| 212 | + --> | ||
| 198 | 213 | ||
| 199 | 214 | Prints to `stdout` with newline. Multiple arguments can be passed, with the | |
| 200 | 215 | first used as the primary message and all additional used as substitution | |
@@ -214,6 +229,9 @@ If formatting elements (e.g. `%d`) are not found in the first string then | |||
| 214 | 229 | values are concatenated. See [`util.format()`][] for more information. | |
| 215 | 230 | ||
| 216 | 231 | ### console.time(label) | |
| 232 | + <!-- YAML | ||
| 233 | + added: v0.1.104 | ||
| 234 | + --> | ||
| 217 | 235 | ||
| 218 | 236 | Used to calculate the duration of a specific operation. To start a timer, call | |
| 219 | 237 | the `console.time()` method, giving it a unique `label` as the only parameter. To stop the | |
@@ -222,6 +240,9 @@ timer, and to get the elapsed time in milliseconds, just call the | |||
| 222 | 240 | timer's unique `label` as the parameter. | |
| 223 | 241 | ||
| 224 | 242 | ### console.timeEnd(label) | |
| 243 | + <!-- YAML | ||
| 244 | + added: v0.1.104 | ||
| 245 | + --> | ||
| 225 | 246 | ||
| 226 | 247 | Stops a timer that was previously started by calling [`console.time()`][] and | |
| 227 | 248 | prints the result to stdout: | |
@@ -236,6 +257,9 @@ console.timeEnd('100-elements'); | |||
| 236 | 257 | ``` | |
| 237 | 258 | ||
| 238 | 259 | ### console.trace(message[, ...]) | |
| 260 | + <!-- YAML | ||
| 261 | + added: v0.1.104 | ||
| 262 | + --> | ||
| 239 | 263 | ||
| 240 | 264 | Prints to `stderr` the string `'Trace :'`, followed by the [`util.format()`][] | |
| 241 | 265 | formatted message and stack trace to the current position in the code. | |
@@ -257,6 +281,9 @@ console.trace('Show me'); | |||
| 257 | 281 | ``` | |
| 258 | 282 | ||
| 259 | 283 | ### console.warn([data][, ...]) | |
| 284 | + <!-- YAML | ||
| 285 | + added: v0.1.100 | ||
| 286 | + --> | ||
| 260 | 287 | ||
| 261 | 288 | The `console.warn()` function is an alias for [`console.error()`][]. | |
| 262 | 289 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments