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: fix paragraph order in stream.md #19501

Closed
wants to merge 1 commit into from
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
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