From 72a9c899045e1ed8000810919c7ee5f9b7d97a26 Mon Sep 17 00:00:00 2001 From: Andreas Girgensohn Date: Wed, 15 Aug 2018 23:03:15 -0700 Subject: [PATCH 1/3] doc/api: clarify the documentation of pipes and zlib objects in them Document how pipes can be chained in readable.pipe(). Document that zlib.Zlib inherits from stream.Transform. Fixes: https://github.com/nodejs/node/issues/22341 --- doc/api/stream.md | 4 ++-- doc/api/zlib.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 578a1cd140b38d..47d15b5accca1c 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -895,8 +895,8 @@ added: v0.9.4 * `destination` {stream.Writable} The destination for writing data * `options` {Object} Pipe options * `end` {boolean} End the writer when the reader ends. **Default:** `true`. -* Returns: {stream.Writable} making it possible to set up chains of piped - streams +* Returns: {stream.Writable} The *destination*, allowing for a chain of pipes if + it is a [`Duplex`][] stream The `readable.pipe()` method attaches a [`Writable`][] stream to the `readable`, causing it to switch automatically into flowing mode and push all of its data diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 746058f5a335dc..84ff20972027ef 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -397,6 +397,9 @@ added: v0.5.8 Not exported by the `zlib` module. It is documented here because it is the base class of the compressor/decompressor classes. +This class inherits from [`stream.Transform`][], allowing `zlib` objects to be +used in pipes and similar stream operations. + ### zlib.bytesRead