From 757de539bf5773c4ba10286d310c18b99d228bdd Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 21 Sep 2019 01:29:41 +0200 Subject: [PATCH 1/4] stream: _write optional when _writev When implementing _writev, _write should be optional. --- doc/api/stream.md | 11 ++++++----- lib/_stream_writable.js | 6 +++++- test/parallel/test-stream-writev.js | 9 +++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 1f0f08a7b86a7f..68a0720f3399e4 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1667,8 +1667,8 @@ const myWritable = new Writable({ The `stream.Writable` class is extended to implement a [`Writable`][] stream. Custom `Writable` streams *must* call the `new stream.Writable([options])` -constructor and implement the `writable._write()` method. The -`writable._writev()` method *may* also be implemented. +constructor and implement the `writable._write()` and/or `writable._writev()` +method. #### Constructor: new stream.Writable([options]) * `chunk` {Buffer|string|any} The `Buffer` to be written, converted from the `string` passed to [`stream.write()`][stream-write]. If the stream's From 6c514271b3070b4f4c58bdb6160934e34967af3c Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 21 Sep 2019 07:59:50 +0200 Subject: [PATCH 4/4] Update doc/api/stream.md Co-Authored-By: Luigi Pinca --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 1447f1b51eda30..4ae7ac38079ef7 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1761,7 +1761,7 @@ const myWritable = new Writable({ changes: - version: REPLACEME pr-url: https://github.com/nodejs/node/pull/29639 - description: _write is optional when providing _writev. + description: _write() is optional when providing _writev(). --> * `chunk` {Buffer|string|any} The `Buffer` to be written, converted from the