Skip to content

Commit c17c7eb

Browse files
陈刚MoonBall
authored andcommitted
doc: readable.push() supports undefined in non-object mode
1 parent 6657b15 commit c17c7eb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

doc/api/stream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,10 @@ class SourceWrapper extends Readable {
17981798
The `readable.push()` method is intended be called only by Readable
17991799
Implementers, and only from within the `readable._read()` method.
18001800

1801+
For streams not operating in object mode, if the `chunk` parameter of
1802+
`readable.push()` is `undefined`, it will be treated as empty string or
1803+
buffer. See [`readable.push('')`][] for more information.
1804+
18011805
#### Errors While Reading
18021806

18031807
It is recommended that errors occurring during the processing of the
@@ -2313,6 +2317,7 @@ contain multi-byte characters.
23132317
[`stream.uncork()`]: #stream_writable_uncork
23142318
[`stream.unpipe()`]: #stream_readable_unpipe_destination
23152319
[`stream.wrap()`]: #stream_readable_wrap_stream
2320+
[`readable.push('')`]: #stream_readable_push
23162321
[`writable.cork()`]: #stream_writable_cork
23172322
[`writable.uncork()`]: #stream_writable_uncork
23182323
[`zlib.createDeflate()`]: zlib.html#zlib_zlib_createdeflate_options

0 commit comments

Comments
 (0)