You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Newbie to using NodeJS + NodeJS streams and I find the documentation very confusing, especially around pipes. I get the idea of piping streams but the documentation on pipe says it is on Readable, accepts a Writable, and returns a Writable and then mentions that it is possible to chain calls to pipe (e.g. r.pipe(z).pipe(w);). However it makes zero mention of how this is possible in the document. pipe returns a Writable, yet according to the document Writable has no pipe method. So how can they be chained?
Fiddling around in node inspecting things I see that the stream package is a class that both Readable and Writable inherit from. Perhaps having the documentation actually show this hierarchy and have more "standard" class documentation would help?
Maybe this isn't shown because piping a Writable stream to another stream makes no sense. What are you piping? You can't read from it. Unless you actually can and the idea of a Writable stream is a lie and everything is a Duplex? Or does it just pass the data over that writable and on to the next stream? Maybe this just a general design issue with Node streams? Or maybe there's an undocumented requirement that in order to chain pipe the argument to pipe must be a Duplex? (Digging further that appears to be the case - Writable has a pipe method that throws when called because it is not readable).
Site note: The example in pipe pipes through a Gzip object. But the documentation for Gzip is non existent and makes no mention that is a stream of any kind except in the small examples at the top of the zlib page. It seems pretty important to me to know that it is not only a stream, but a Transform that zips the input stream and outputs the zipped data.
I'm not looking for help using streams or gzip or anything else. Just noting that as someone totally new the documentation is in need of improvement. Especially for something that is presumably very core to Node as streams. Basically clearer documentation around pipe and its requirements (chaining requires streams be Duplexs) and what classes are streams - specifically what kind of stream (like Gzip is a Transform). More generally I'd say the "classic" documentation of documenting classes, methods, and hierarchies is more useful than entirely example based documentation.
The text was updated successfully, but these errors were encountered:
addaleax
added
doc
Issues and PRs related to the documentations.
stream
Issues and PRs related to the stream subsystem.
zlib
Issues and PRs related to the zlib subsystem.
labels
May 9, 2018
Newbie to using NodeJS + NodeJS streams and I find the documentation very confusing, especially around pipes. I get the idea of piping streams but the documentation on
pipe
says it is onReadable
, accepts aWritable
, and returns aWritable
and then mentions that it is possible to chain calls topipe
(e.g.r.pipe(z).pipe(w);
). However it makes zero mention of how this is possible in the document.pipe
returns aWritable
, yet according to the documentWritable
has nopipe
method. So how can they be chained?Fiddling around in node inspecting things I see that the
stream
package is a class that bothReadable
andWritable
inherit from. Perhaps having the documentation actually show this hierarchy and have more "standard" class documentation would help?Maybe this isn't shown because piping a
Writable
stream to another stream makes no sense. What are you piping? You can't read from it. Unless you actually can and the idea of aWritable
stream is a lie and everything is aDuplex
? Or does it just pass the data over that writable and on to the next stream? Maybe this just a general design issue with Node streams? Or maybe there's an undocumented requirement that in order to chainpipe
the argument topipe
must be aDuplex
? (Digging further that appears to be the case -Writable
has apipe
method that throws when called because it is not readable).Site note: The example in
pipe
pipes through aGzip
object. But the documentation forGzip
is non existent and makes no mention that is a stream of any kind except in the small examples at the top of the zlib page. It seems pretty important to me to know that it is not only a stream, but aTransform
that zips the input stream and outputs the zipped data.I'm not looking for help using streams or gzip or anything else. Just noting that as someone totally new the documentation is in need of improvement. Especially for something that is presumably very core to Node as streams. Basically clearer documentation around
pipe
and its requirements (chaining requires streams beDuplex
s) and what classes are streams - specifically what kind of stream (likeGzip
is aTransform
). More generally I'd say the "classic" documentation of documenting classes, methods, and hierarchies is more useful than entirely example based documentation.The text was updated successfully, but these errors were encountered: