Skip to content

Commit a2c0fcc

Browse files
prog1devvsemozhetbyt
authored andcommitted
doc: add returned values and options to stream.md
PR-URL: #19361 Refs: #11135 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
1 parent cd7d7b1 commit a2c0fcc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/api/stream.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,8 @@ added: v0.9.4
860860
* `destination` {stream.Writable} The destination for writing data
861861
* `options` {Object} Pipe options
862862
* `end` {boolean} End the writer when the reader ends. Defaults to `true`.
863+
* Returns: {stream.Writable} making it possible to set up chains of piped
864+
streams
863865

864866
The `readable.pipe()` method attaches a [Writable][] stream to the `readable`,
865867
causing it to switch automatically into flowing mode and push all of its data
@@ -916,7 +918,9 @@ closed until the Node.js process exits, regardless of the specified options.
916918
added: v9.3.0
917919
-->
918920

919-
Return the value of `highWaterMark` passed when constructing this
921+
* Returns: {number}
922+
923+
Returns the value of `highWaterMark` passed when constructing this
920924
`Readable`.
921925

922926
##### readable.read([size])
@@ -925,7 +929,7 @@ added: v0.9.4
925929
-->
926930

927931
* `size` {number} Optional argument to specify how much data to read.
928-
* Return {string|Buffer|null}
932+
* Returns: {string|Buffer|null}
929933

930934
The `readable.read()` method pulls some data out of the internal buffer and
931935
returns it. If no data available to be read, `null` is returned. By default,
@@ -970,6 +974,8 @@ been emitted will return `null`. No runtime error will be raised.
970974
added: v9.4.0
971975
-->
972976

977+
* Returns: {number}
978+
973979
This property contains the number of bytes (or objects) in the queue
974980
ready to be read. The value provides introspection data regarding
975981
the status of the `highWaterMark`.
@@ -1034,6 +1040,7 @@ added: v0.9.4
10341040
-->
10351041

10361042
* `destination` {stream.Writable} Optional specific stream to unpipe
1043+
* Returns: {this}
10371044

10381045
The `readable.unpipe()` method detaches a Writable stream previously attached
10391046
using the [`stream.pipe()`][] method.
@@ -1135,6 +1142,7 @@ added: v0.9.4
11351142
-->
11361143

11371144
* `stream` {Stream} An "old style" readable stream
1145+
* Returns: {this}
11381146

11391147
Versions of Node.js prior to v0.10 had streams that did not implement the
11401148
entire `stream` module API as it is currently defined. (See [Compatibility][]
@@ -1165,6 +1173,9 @@ myReader.on('readable', () => {
11651173
added: v8.0.0
11661174
-->
11671175

1176+
* `error` {Error} Error which will be passed as payload in `'error'` event
1177+
* Returns: {this}
1178+
11681179
Destroy the stream, and emit `'error'` and `close`. After this call, the
11691180
readable stream will release any internal resources and subsequent calls
11701181
to `push` will be ignored.

0 commit comments

Comments
 (0)