Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

Commit 49f1af7

Browse files
jasnelljBarz
authored andcommitted
doc: additional refinement to readable event
Per nodejs#25635 (comment) Additional refinement to the clarification on the `readable` event Reviewed-By: James M Snell <[email protected]> PR-URL: nodejs#25591
1 parent ab988cc commit 49f1af7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

doc/api/stream.markdown

+4-5
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,10 @@ again when more data is available.
167167
The `readable` event is not emitted in the "flowing" mode with the
168168
sole exception of the last one, on end-of-stream.
169169

170-
Note that the `'readable'` event indicates only that data *can* be
171-
read from the stream. It does not indicate whether there is actual
172-
data to be consumed. The callback passed to handle the `'readable'`
173-
event must be prepared to handle a `null` response from
174-
`readable.read([size])`. For instance, in the following example, `foo.txt`
170+
The 'readable' event indicates that the stream has new information:
171+
either new data is available or the end of the stream has been reached.
172+
In the former case, `.read()` will return that data. In the latter case,
173+
`.read()` will return null. For instance, in the following example, `foo.txt`
175174
is an empty file:
176175

177176
```javascript

0 commit comments

Comments
 (0)