Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Add a note about readable in flowing mode #8682

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
4 changes: 4 additions & 0 deletions doc/api/stream.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ readable.on('readable', function() {
Once the internal buffer is drained, a `readable` event will fire
again when more data is available.

The `readable` event is not emitted in the "flowing" mode with the sole exception of the last one, on end-of-stream.

#### Event: 'data'

* `chunk` {Buffer | String} The chunk of data.
Expand All @@ -182,6 +184,8 @@ readable.on('data', function(chunk) {
})
```

Note that `'readable'` event should not be used together with `'data'`, because the assigning the latter switches the stream into the "flowing" mode, so the `'readable'` event will not emitted.

#### Event: 'end'

This event fires when there will be no more data to read.
Expand Down