From fbf660af7c3f18cb6459e9556044a6f1f7c7c25d Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 26 Nov 2021 20:37:33 +0100 Subject: [PATCH 1/2] util: add numericSeparator to util.inspect This adds the `numericSeparator` option to util.inspect. Using it separates numbers by thousands adding the underscore accordingly. Signed-off-by: Ruben Bridgewater --- doc/api/util.md | 5 ++ lib/internal/util/inspect.js | 116 +++++++++++++++++++++++------ test/parallel/test-util-format.js | 31 ++++++++ test/parallel/test-util-inspect.js | 49 ++++++++++++ 4 files changed, 178 insertions(+), 23 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 3810b1145cd7cc..8f22dc99cf719d 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -485,6 +485,9 @@ stream.write('With ES6');