Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix typo in cjs example of util.styleText #56769

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

deokjinkim
Copy link
Contributor

errorMessage needs to be printed instead of successMessage in console.error().
ESM example is only fixed in previous PR.

Refs: #56720

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. util Issues and PRs related to the built-in util module. labels Jan 26, 2025
@UlisesGascon
Copy link
Member

UlisesGascon commented Jan 26, 2025

Thanks @deokjinkim for creating this PR, but we just recently landed #56720.

@deokjinkim
Copy link
Contributor Author

deokjinkim commented Jan 26, 2025

Thanks @deokjinkim for creating this PR, but we just recently landed #56720.

@UlisesGascon As I mentioned in PR description, only ESM example is fixed in #56720 like below: (line 1975)

node/doc/api/util.md

Lines 1969 to 1975 in ce6a628

const errorMessage = styleText(
'red',
'Error! Error!',
// Validate if process.stderr has TTY
{ stream: stderr },
);
console.error(errorMessage);

CJS example is not fixed yet(line 1991). So I created this PR.

node/doc/api/util.md

Lines 1985 to 1991 in ce6a628

const errorMessage = styleText(
'red',
'Error! Error!',
// Validate if process.stderr has TTY
{ stream: stderr },
);
console.error(successMessage);

@deokjinkim deokjinkim reopened this Jan 26, 2025
Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! Sorry for the early closing 😅

`errorMessage` needs to be printed instead of
`successMessage` in console.error(). ESM example is
only fixed in previous PR.

Refs: nodejs#56720
@deokjinkim deokjinkim added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 30, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2025
@nodejs-github-bot nodejs-github-bot merged commit 7f18407 into nodejs:main Jan 30, 2025
21 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 7f18407

targos pushed a commit that referenced this pull request Feb 2, 2025
`errorMessage` needs to be printed instead of
`successMessage` in console.error(). ESM example is
only fixed in previous PR.

Refs: #56720
PR-URL: #56769
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jason Zhang <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants