@@ -1687,8 +1687,8 @@ const myWritable = new Writable({
1687
1687
The ` stream.Writable ` class is extended to implement a [ ` Writable ` ] [ ] stream.
1688
1688
1689
1689
Custom ` Writable ` streams * must* call the ` new stream.Writable([options]) `
1690
- constructor and implement the ` writable._write() ` method. The
1691
- ` writable._writev() ` method * may * also be implemented .
1690
+ constructor and implement the ` writable._write() ` and/or ` writable._writev() `
1691
+ method.
1692
1692
1693
1693
#### Constructor: new stream.Writable([ options] )
1694
1694
<!-- YAML
@@ -1777,6 +1777,12 @@ const myWritable = new Writable({
1777
1777
```
1778
1778
1779
1779
#### writable.\_ write(chunk, encoding, callback)
1780
+ <!-- YAML
1781
+ changes:
1782
+ - version: REPLACEME
1783
+ pr-url: https://github.com/nodejs/node/pull/29639
1784
+ description: _write() is optional when providing _writev().
1785
+ -->
1780
1786
1781
1787
* ` chunk ` {Buffer|string|any} The ` Buffer ` to be written, converted from the
1782
1788
` string ` passed to [ ` stream.write() ` ] [ stream-write ] . If the stream's
@@ -1790,7 +1796,8 @@ const myWritable = new Writable({
1790
1796
argument) when processing is complete for the supplied chunk.
1791
1797
1792
1798
All ` Writable ` stream implementations must provide a
1793
- [ ` writable._write() ` ] [ stream-_write ] method to send data to the underlying
1799
+ [ ` writable._write() ` ] [ stream-_write ] and/or
1800
+ [ ` writable._writev() ` ] [ stream-_writev ] method to send data to the underlying
1794
1801
resource.
1795
1802
1796
1803
[ ` Transform ` ] [ ] streams provide their own implementation of the
@@ -1833,8 +1840,8 @@ This function MUST NOT be called by application code directly. It should be
1833
1840
implemented by child classes, and called by the internal ` Writable ` class
1834
1841
methods only.
1835
1842
1836
- The ` writable._writev() ` method may be implemented in addition to
1837
- ` writable._write() ` in stream implementations that are capable of processing
1843
+ The ` writable._writev() ` method may be implemented in addition or alternatively
1844
+ to ` writable._write() ` in stream implementations that are capable of processing
1838
1845
multiple chunks of data at once. If implemented, the method will be called with
1839
1846
all chunks of data currently buffered in the write queue.
1840
1847
0 commit comments