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