From 7f18407d0fd243bfe7115dafae02b7a034c64130 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Thu, 30 Jan 2025 11:02:58 +0900 Subject: [PATCH] doc: fix typo in cjs example of `util.styleText` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `errorMessage` needs to be printed instead of `successMessage` in console.error(). ESM example is only fixed in previous PR. Refs: https://github.com/nodejs/node/pull/56720 PR-URL: https://github.com/nodejs/node/pull/56769 Reviewed-By: Ulises Gascón Reviewed-By: Luigi Pinca Reviewed-By: Jason Zhang Reviewed-By: James M Snell --- doc/api/util.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/util.md b/doc/api/util.md index 958a49977e1a17..f6a57f133ea1ff 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1988,7 +1988,7 @@ const errorMessage = styleText( // Validate if process.stderr has TTY { stream: stderr }, ); -console.error(successMessage); +console.error(errorMessage); ``` `util.inspect.colors` also provides text formats such as `italic`, and