doc: add returned values and options to stream.md

PR-URL: https://github.com/nodejs/node/pull/19361
Refs: https://github.com/nodejs/node/issues/11135
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
This commit is contained in:
Ivan Filenko 2018-03-15 03:28:34 +03:00 committed by Vse Mozhet Byt
parent cd7d7b15c1
commit a2c0fcc0d8

View File

@ -860,6 +860,8 @@ added: v0.9.4
* `destination` {stream.Writable} The destination for writing data * `destination` {stream.Writable} The destination for writing data
* `options` {Object} Pipe options * `options` {Object} Pipe options
* `end` {boolean} End the writer when the reader ends. Defaults to `true`. * `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`, 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 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.
added: v9.3.0 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`.
##### readable.read([size]) ##### readable.read([size])
@ -925,7 +929,7 @@ added: v0.9.4
--> -->
* `size` {number} Optional argument to specify how much data to read. * `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 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, 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.
added: v9.4.0 added: v9.4.0
--> -->
* Returns: {number}
This property contains the number of bytes (or objects) in the queue This property contains the number of bytes (or objects) in the queue
ready to be read. The value provides introspection data regarding ready to be read. The value provides introspection data regarding
the status of the `highWaterMark`. the status of the `highWaterMark`.
@ -1034,6 +1040,7 @@ added: v0.9.4
--> -->
* `destination` {stream.Writable} Optional specific stream to unpipe * `destination` {stream.Writable} Optional specific stream to unpipe
* Returns: {this}
The `readable.unpipe()` method detaches a Writable stream previously attached The `readable.unpipe()` method detaches a Writable stream previously attached
using the [`stream.pipe()`][] method. using the [`stream.pipe()`][] method.
@ -1135,6 +1142,7 @@ added: v0.9.4
--> -->
* `stream` {Stream} An "old style" readable stream * `stream` {Stream} An "old style" readable stream
* Returns: {this}
Versions of Node.js prior to v0.10 had streams that did not implement the 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][] entire `stream` module API as it is currently defined. (See [Compatibility][]
@ -1165,6 +1173,9 @@ myReader.on('readable', () => {
added: v8.0.0 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 Destroy the stream, and emit `'error'` and `close`. After this call, the
readable stream will release any internal resources and subsequent calls readable stream will release any internal resources and subsequent calls
to `push` will be ignored. to `push` will be ignored.