summaryrefslogtreecommitdiff
path: root/doc/api/util.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-04-02 23:52:15 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-04-15 17:30:53 +0200
commitffd2df063c4671e006eba87a0be33357e54964a6 (patch)
treec63a26495bfc00e968ec345352da496d67aa5f58 /doc/api/util.md
parent90e958aa4d225ff1174abea3547da9f7581e0b72 (diff)
downloadandroid-node-v8-ffd2df063c4671e006eba87a0be33357e54964a6.tar.gz
android-node-v8-ffd2df063c4671e006eba87a0be33357e54964a6.tar.bz2
android-node-v8-ffd2df063c4671e006eba87a0be33357e54964a6.zip
doc: update util colors
This updates the customization of colors for `util.inspect`. A couple entries were missing and this also adds a reference to check for colors. PR-URL: https://github.com/nodejs/node/pull/27052 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r--doc/api/util.md15
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/api/util.md b/doc/api/util.md
index 4d8cfda1d9..3c01170673 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -638,23 +638,25 @@ via the `util.inspect.styles` and `util.inspect.colors` properties.
The default styles and associated colors are:
-* `number` - `yellow`
+* `bigint` - `yellow`
* `boolean` - `yellow`
-* `string` - `green`
* `date` - `magenta`
* `module` - `underline`
-* `regexp` - `red`
+* `name` - (no styling)
* `null` - `bold`
+* `number` - `yellow`
+* `regexp` - `red`
+* `special` - `cyan` (e.g., `Proxies`)
+* `string` - `green`
+* `symbol` - `green`
* `undefined` - `grey`
-* `special` - `cyan` (only applied to functions at this time)
-* `name` - (no styling)
The predefined color codes are: `white`, `grey`, `black`, `blue`, `cyan`,
`green`, `magenta`, `red` and `yellow`. There are also `bold`, `italic`,
`underline` and `inverse` codes.
Color styling uses ANSI control codes that may not be supported on all
-terminals.
+terminals. To verify color support use [`tty.hasColors()`][].
### Custom inspection functions on Objects
@@ -2191,6 +2193,7 @@ util.log('Timestamped message.');
[`assert.deepStrictEqual()`]: assert.html#assert_assert_deepstrictequal_actual_expected_message
[`console.error()`]: console.html#console_console_error_data_args
[`target` and `handler`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Terminology
+[`tty.hasColors()`]: tty.html#tty_writestream_hascolors_count_env
[`util.format()`]: #util_util_format_format_args
[`util.inspect()`]: #util_util_inspect_object_options
[`util.promisify()`]: #util_util_promisify_original