Skip to content

Commit

Permalink
doc: fix paragraph order in stream.md
Browse files Browse the repository at this point in the history
Place `writable.destroy()`, `readable.destroy()`,
and `readable.read()` in the proper ABC order.

PR-URL: #19501
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
vsemozhetbyt committed Mar 21, 2018
1 parent 1b8746f commit 3662934
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,19 @@ buffered writes in a more optimized manner.

See also: [`writable.uncork()`][].

##### writable.destroy([error])
<!-- YAML
added: v8.0.0
-->

* Returns: {this}

Destroy the stream, and emit the passed `error` and a `close` event.
After this call, the writable stream has ended and subsequent calls
to `write` / `end` will give an `ERR_STREAM_DESTROYED` error.
Implementors should not override this method,
but instead implement [`writable._destroy`][writable-_destroy].

##### writable.end([chunk][, encoding][, callback])
<!-- YAML
added: v0.9.4
Expand Down Expand Up @@ -536,19 +549,6 @@ write('hello', () => {

A Writable stream in object mode will always ignore the `encoding` argument.

##### writable.destroy([error])
<!-- YAML
added: v8.0.0
-->

* Returns: {this}

Destroy the stream, and emit the passed `error` and a `close` event.
After this call, the writable stream has ended and subsequent calls
to `write` / `end` will give an `ERR_STREAM_DESTROYED` error.
Implementors should not override this method,
but instead implement [`writable._destroy`][writable-_destroy].

### Readable Streams

Readable streams are an abstraction for a *source* from which data is
Expand Down Expand Up @@ -806,6 +806,20 @@ In general, the `readable.pipe()` and `'data'` event mechanisms are easier to
understand than the `'readable'` event. However, handling `'readable'` might
result in increased throughput.

##### readable.destroy([error])
<!-- YAML
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.
Implementors should not override this method, but instead implement
[`readable._destroy`][readable-_destroy].

##### readable.isPaused()
<!-- YAML
added: v0.11.14
Expand Down Expand Up @@ -913,16 +927,6 @@ to prevent memory leaks.
The [`process.stderr`][] and [`process.stdout`][] Writable streams are never
closed until the Node.js process exits, regardless of the specified options.

##### readable.readableHighWaterMark
<!-- YAML
added: v9.3.0
-->

* Returns: {number}

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

##### readable.read([size])
<!-- YAML
added: v0.9.4
Expand Down Expand Up @@ -969,6 +973,16 @@ also be emitted.
Calling [`stream.read([size])`][stream-read] after the [`'end'`][] event has
been emitted will return `null`. No runtime error will be raised.

##### readable.readableHighWaterMark
<!-- YAML
added: v9.3.0
-->

* Returns: {number}

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

##### readable.readableLength
<!-- YAML
added: v9.4.0
Expand Down Expand Up @@ -1168,20 +1182,6 @@ myReader.on('readable', () => {
});
```

##### readable.destroy([error])
<!-- YAML
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.
Implementors should not override this method, but instead implement
[`readable._destroy`][readable-_destroy].

##### readable[@@asyncIterator]
<!-- YAML
added: REPLACEME
Expand Down

0 comments on commit 3662934

Please sign in to comment.