镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

doc: add print results for examples in WebStreams - #49143

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
pluris:fix/missing_prints_webstream
Aug 15, 2023
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
pluris:fix/missing_prints_webstream

Conversation

@pluris

@pluris pluris commented Aug 13, 2023

Copy link
Copy Markdown
Contributor

As with the other examples, I added something about the resulting output.(Only output results that do not change)

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to Node.js documentation. label Aug 13, 2023
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Aug 14, 2023
Comment thread doc/api/webstreams.md Outdated

for await (const chunk of transformedStream)
console.log(chunk);
// Prints A

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints A
// Prints: A

Comment thread doc/api/webstreams.md Outdated
(async () => {
for await (const chunk of transformedStream)
console.log(chunk);
// Prints A

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints A
// Prints: A

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from(dataArray);
const data = await arrayBuffer(readable);
console.log(`from readable: ${data.byteLength}`);
// Prints from readable: 76

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 76
// Prints: from readable: 76

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from(dataArray);
arrayBuffer(readable).then((data) => {
console.log(`from readable: ${data.byteLength}`);
// Prints from readable: 76

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 76
// Prints: from readable: 76

Comment thread doc/api/webstreams.md Outdated
const readable = dataBlob.stream();
const data = await blob(readable);
console.log(`from readable: ${data.size}`);
// Prints from readable: 27

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 27
// Prints: from readable: 27

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from(dataBuffer);
buffer(readable).then((data) => {
console.log(`from readable: ${data.length}`);
// Prints from readable: 27

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 27
// Prints: from readable: 27

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from(JSON.stringify(items));
const data = await json(readable);
console.log(`from readable: ${data.length}`);
// Prints from readable: 100

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 100
// Prints: from readable: 100

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from(JSON.stringify(items));
json(readable).then((data) => {
console.log(`from readable: ${data.length}`);
// Prints from readable: 100

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 100
// Prints: from readable: 100

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from('Hello world from consumers!');
const data = await text(readable);
console.log(`from readable: ${data.length}`);
// Prints from readable: 27

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 27
// Prints: from readable: 27

Comment thread doc/api/webstreams.md Outdated
const readable = Readable.from('Hello world from consumers!');
text(readable).then((data) => {
console.log(`from readable: ${data.length}`);
// Prints from readable: 27

ghost Aug 14, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Prints from readable: 27
// Prints: from readable: 27

@lpinca

ghost commented Aug 14, 2023

Copy link
Copy Markdown
Member
$ git grep "// Prints:" doc/ | wc -l
     505
$ git grep "// Prints " doc/ | wc -l
     115

@pluris

ghost commented Aug 15, 2023

Copy link
Copy Markdown
Contributor Author

@lpinca Hi, thank you for your opinion.
They are mixed in both ways, but most of them use Prints: more.
I think the document I referenced wrote Prints. 😓
I fixed it.

@lpinca lpinca added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Aug 15, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 15, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 9a2e6bc into nodejs:main Aug 15, 2023
@nodejs-github-bot

ghost commented Aug 15, 2023

Copy link
Copy Markdown
Collaborator

Landed in 9a2e6bc

@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
@pluris
pluris deleted the fix/missing_prints_webstream branch August 30, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. doc Issues and PRs related to Node.js documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants