Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add return values and missing options to stream readable docs #19361

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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