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: add esm examples to node:console #54108

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

mfdebian
Copy link
Contributor

@mfdebian mfdebian commented Jul 29, 2024

This PR adds the ESM counterparts of the CJS examples for the Console documentation.

It also includes the missing require statements for fs and Console used in this particular CJS example just to be concise with the rest of the documentation (as in stream.pipeline(streams[, options]) for example).

Also the documentation states we can either do:

//CJS
const { Console } = require('node:console');
//ESM
import { Console } from 'node:console';

Or

const { Console } = console;

I've kept that on both the ESM and CJS examples so new users don't get confused about it.

Best regards.

@nodejs-github-bot nodejs-github-bot added console Issues and PRs related to the console subsystem. doc Issues and PRs related to the documentations. labels Jul 29, 2024
@targos targos added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 6, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 6, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54108
✔  Done loading data for nodejs/node/pull/54108
----------------------------------- PR info ------------------------------------
Title      doc: add esm examples to `node:console` (#54108)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     mfdebian:docs-console-esm -> nodejs:main
Labels     doc, console
Commits    2
 - doc: add esm examples to node:console
 - fix: add node prefix to fix linter error
Committers 1
 - Alfredo González <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/54108
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54108
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 29 Jul 2024 22:25:58 GMT
   ✔  Approvals: 4
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/54108#pullrequestreview-2208500175
   ✔  - Jake Yuesong Li (@jakecastelli): https://github.com/nodejs/node/pull/54108#pullrequestreview-2209555625
   ✔  - Ulises Gascón (@UlisesGascon): https://github.com/nodejs/node/pull/54108#pullrequestreview-2210904521
   ✔  - Trivikram Kamat (@trivikr): https://github.com/nodejs/node/pull/54108#pullrequestreview-2217818127
   ✔  Last GitHub CI successful
   ℹ  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 54108
From https://github.com/nodejs/node
 * branch                  refs/pull/54108/merge -> FETCH_HEAD
✔  Fetched commits as 2b41c237c03e..cf2b2977180e
--------------------------------------------------------------------------------
[main 081bb0fa8a] doc: add esm examples to node:console
 Author: Alfredo González <[email protected]>
 Date: Mon Jul 29 18:16:27 2024 -0400
 1 file changed, 27 insertions(+), 2 deletions(-)
[main befd784103] fix: add node prefix to fix linter error
 Author: Alfredo González <[email protected]>
 Date: Mon Jul 29 18:29:21 2024 -0400
 1 file changed, 1 insertion(+), 1 deletion(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: add esm examples to node:console

PR-URL: #54108
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>

[detached HEAD 4d0d9c6143] doc: add esm examples to node:console
Author: Alfredo González <[email protected]>
Date: Mon Jul 29 18:16:27 2024 -0400
1 file changed, 27 insertions(+), 2 deletions(-)
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fix: add node prefix to fix linter error

PR-URL: #54108
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>

[detached HEAD 44be6ea6a6] fix: add node prefix to fix linter error
Author: Alfredo González <[email protected]>
Date: Mon Jul 29 18:29:21 2024 -0400
1 file changed, 1 insertion(+), 1 deletion(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/10262942531

@jakecastelli jakecastelli added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 6, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 6, 2024
@nodejs-github-bot nodejs-github-bot merged commit fd49758 into nodejs:main Aug 6, 2024
25 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in fd49758

@mfdebian mfdebian deleted the docs-console-esm branch August 6, 2024 18:51
targos pushed a commit that referenced this pull request Aug 14, 2024
PR-URL: #54108
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jake Yuesong Li <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. console Issues and PRs related to the console subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants