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: backpressuring in streams guide #1668

Closed
Bamieh opened this issue May 30, 2018 · 1 comment
Closed

doc: backpressuring in streams guide #1668

Bamieh opened this issue May 30, 2018 · 1 comment

Comments

@Bamieh
Copy link

Bamieh commented May 30, 2018

In the backpressuring-in-streams guide, this line of text should be updated:

pump is a utility tool that would properly destroy all the streams in a pipeline if one of them fails or closes, and is a must have in this case!

As of node 10, pipeline is introduced to solve this issue, so there is no need to reference an external utility any more 🎉 . I believe the guide should reflect on this new feature providing a small code snippet along with a link to the docs.

const pipeline = util.promisify(stream.pipeline);

async function run() {
  await pipeline(
    fs.createReadStream('archive.tar'),
    zlib.createGzip(),
    fs.createWriteStream('archive.tar.gz')
  );
  console.log('Pipeline succeeded');
}

I am willing to submit a PR if I am on the right track.

Cheers!

@ghost
Copy link

ghost commented Aug 2, 2018

@Bamieh:Thanks and I've included the submit. Feel free to submit your ideas.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant