You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Unify periods and upper case in comments.
* Add missing parentheses for methods.
* Add missing backticks.
* Fix sorting position of `writable.writableFinished` section.
* Replace a one-letter variable with a more readable one.
* `catch(console.log)` -> `catch(console.error)`.
* Document missing `emitClose` option in `new stream.Readable()` section
mentioned in https://nodejs.org/api/stream.html#stream_event_close_1
and https://nodejs.org/api/stream.html#stream_readable_destroy_error
copying from the `new stream.Writable()` section.
Refs: https://github.com/nodejs/node/blob/36fdf1aa6c87ccfaebabb8f9c8004baab0549b0b/lib/_stream_readable.js#L121
PR-URL: #28591
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
If the loop terminates with a `break` or a `throw`, the stream will be
@@ -1425,7 +1424,7 @@ finished(rs, (err) => {
1425
1424
}
1426
1425
});
1427
1426
1428
-
rs.resume(); //drain the stream
1427
+
rs.resume(); //Drain the stream.
1429
1428
```
1430
1429
1431
1430
Especially useful in error handling scenarios where a stream is destroyed
@@ -1445,7 +1444,7 @@ async function run() {
1445
1444
}
1446
1445
1447
1446
run().catch(console.error);
1448
-
rs.resume(); //drain the stream
1447
+
rs.resume(); //Drain the stream.
1449
1448
```
1450
1449
1451
1450
### stream.pipeline(...streams, callback)
@@ -1508,6 +1507,7 @@ run().catch(console.error);
1508
1507
*`options` {Object} Options provided to `new stream.Readable([options])`.
1509
1508
By default, `Readable.from()` will set `options.objectMode` to `true`, unless
1510
1509
this is explicitly opted out by setting `options.objectMode` to `false`.
1510
+
* Returns: {stream.Readable}
1511
1511
1512
1512
A utility method for creating Readable Streams out of iterators.
1513
1513
@@ -1555,10 +1555,10 @@ on the type of stream being created, as detailed in the chart below:
1555
1555
1556
1556
| Use-case | Class | Method(s) to implement |
1557
1557
| -------- | ----- | ---------------------- |
1558
-
| Reading only |[`Readable`]| <code>[_read][stream-_read]</code> |
1559
-
| Writing only |[`Writable`]| <code>[_write][stream-_write]</code>, <code>[_writev][stream-_writev]</code>, <code>[_final][stream-_final]</code> |
1560
-
| Reading and writing |[`Duplex`]| <code>[_read][stream-_read]</code>, <code>[_write][stream-_write]</code>, <code>[_writev][stream-_writev]</code>, <code>[_final][stream-_final]</code> |
1561
-
| Operate on written data, then read the result |[`Transform`]| <code>[_transform][stream-_transform]</code>, <code>[_flush][stream-_flush]</code>, <code>[_final][stream-_final]</code> |
1558
+
| Reading only |[`Readable`]| <code>[_read()][stream-_read]</code> |
1559
+
| Writing only |[`Writable`]| <code>[_write()][stream-_write]</code>, <code>[_writev()][stream-_writev]</code>, <code>[_final()][stream-_final]</code> |
1560
+
| Reading and writing |[`Duplex`]| <code>[_read()][stream-_read]</code>, <code>[_write()][stream-_write]</code>, <code>[_writev()][stream-_writev]</code>, <code>[_final()][stream-_final]</code> |
1561
+
| Operate on written data, then read the result |[`Transform`]| <code>[_transform()][stream-_transform]</code>, <code>[_flush()][stream-_flush]</code>, <code>[_final()][stream-_final]</code> |
1562
1562
1563
1563
The implementation code for a stream should *never* call the "public" methods
1564
1564
of a stream that are intended for use by consumers (as described in the
0 commit comments