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 1 commit
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
14 changes: 12 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit: this is usually * Returns: (with a colon). The same for some other additions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 51f9814


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 +917,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 +928,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 +973,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 +1039,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 +1141,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 +1172,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