diff options
author | 陈刚 <chengang07@meituan.com> | 2018-01-22 00:58:35 +0800 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-02-26 10:23:45 +0100 |
commit | 8b518edf114446eedc3f0f828e78d9eae6f74af2 (patch) | |
tree | 48bee15e9172160f05a4b70bef2d21885ca4ebbd /doc/api/stream.md | |
parent | cae41827610667d987a557ed828f89574fad9cf2 (diff) | |
download | android-node-v8-8b518edf114446eedc3f0f828e78d9eae6f74af2.tar.gz android-node-v8-8b518edf114446eedc3f0f828e78d9eae6f74af2.tar.bz2 android-node-v8-8b518edf114446eedc3f0f828e78d9eae6f74af2.zip |
doc: `readable.push(undefined)` in non-object mode
`readable.push()` supports `undefined` in non-object mode, but it was
not previously documented.
PR-URL: https://github.com/nodejs/node/pull/18283
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc/api/stream.md')
-rw-r--r-- | doc/api/stream.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index 4cb9907202..08bdaf0df2 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1808,6 +1808,10 @@ class SourceWrapper extends Readable { The `readable.push()` method is intended be called only by Readable Implementers, and only from within the `readable._read()` method. +For streams not operating in object mode, if the `chunk` parameter of +`readable.push()` is `undefined`, it will be treated as empty string or +buffer. See [`readable.push('')`][] for more information. + #### Errors While Reading It is recommended that errors occurring during the processing of the @@ -2323,6 +2327,7 @@ contain multi-byte characters. [`stream.uncork()`]: #stream_writable_uncork [`stream.unpipe()`]: #stream_readable_unpipe_destination [`stream.wrap()`]: #stream_readable_wrap_stream +[`readable.push('')`]: #stream_readable_push [`writable.cork()`]: #stream_writable_cork [`writable.uncork()`]: #stream_writable_uncork [`zlib.createDeflate()`]: zlib.html#zlib_zlib_createdeflate_options |