Node: Simplify docs on how to pipe from an async Iterator to a Writable

Created on 29 May 2020  路  6Comments  路  Source: nodejs/node

In https://nodejs.org/api/stream.html#stream_piping_to_writable_streams_from_async_iterators we should how to use Events.on and Promise.race() to write to a Writable. However, pipeline already support this and this can be greatly simplified. See https://nodejs.org/api/stream.html#stream_stream_pipeline_source_transforms_destination_callback.

doc good first issue stream

Most helpful comment

I can take a stab at updating the documentation if no one is working on this. May I please just confirm that the only requirement is that the code snippet use pipeline instead of doing it manually... is that correct?

All 6 comments

cc @nodejs/streams

I agree. That section mostly shows how complicated it can be. Remove it or update to use pipeline?

I would just update to use pipeline.

I can take a stab at updating the documentation if no one is working on this. May I please just confirm that the only requirement is that the code snippet use pipeline instead of doing it manually... is that correct?

yes

This issues has been solved and can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ksushilmaurya picture ksushilmaurya  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments

mcollina picture mcollina  路  3Comments

danialkhansari picture danialkhansari  路  3Comments

cong88 picture cong88  路  3Comments