Skip to content

Commit

Permalink
doc: add returned values and options to stream.md
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
prog1dev authored and vsemozhetbyt committed Mar 15, 2018
1 parent cd7d7b1 commit a2c0fcc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,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. Defaults to `true`.
* Returns: {stream.Writable} making it possible to set up chains of piped
streams

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
Expand Down Expand Up @@ -916,7 +918,9 @@ closed until the Node.js process exits, regardless of the specified options.
added: v9.3.0
-->

Return the value of `highWaterMark` passed when constructing this
* Returns: {number}

Returns the value of `highWaterMark` passed when constructing this
`Readable`.

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

* `size` {number} Optional argument to specify how much data to read.
* Return {string|Buffer|null}
* Returns: {string|Buffer|null}

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

* Returns: {number}

This property contains the number of bytes (or objects) in the queue
ready to be read. The value provides introspection data regarding
the status of the `highWaterMark`.
Expand Down Expand Up @@ -1034,6 +1040,7 @@ added: v0.9.4
-->

* `destination` {stream.Writable} Optional specific stream to unpipe
* Returns: {this}

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

* `stream` {Stream} An "old style" readable stream
* Returns: {this}

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

* `error` {Error} Error which will be passed as payload in `'error'` event
* Returns: {this}

Destroy the stream, and emit `'error'` and `close`. After this call, the
readable stream will release any internal resources and subsequent calls
to `push` will be ignored.
Expand Down

0 comments on commit a2c0fcc

Please sign in to comment.