Skip to content

Commit eda2560

Browse files
committed
doc: additional refinement to readable event
Per nodejs/node-v0.x-archive#25635 (comment) Additional refinement to the clarification on the `readable` event Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
1 parent 881d9be commit eda2560

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)