Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eef7489

Browse filesBrowse files
marco-ippolitoRafaelGSS
authored andcommitted
doc: duplex and readable from uncaught execption warning
PR-URL: #46135 Fixes: #46071 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent c77b0da commit eef7489
Copy full SHA for eef7489

File tree

Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+24Lines changed: 24 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,18 @@ Calling `Readable.from(string)` or `Readable.from(buffer)` will not have
29122912
the strings or buffers be iterated to match the other streams semantics
29132913
for performance reasons.
29142914

2915+
If an `Iterable` object containing promises is passed as an argument,
2916+
it might result in unhandled rejection.
2917+
2918+
```js
2919+
const { Readable } = require('node:stream');
2920+
2921+
Readable.from([
2922+
new Promise((resolve) => setTimeout(resolve('1'), 1500)),
2923+
new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection
2924+
]);
2925+
```
2926+
29152927
### `stream.Readable.fromWeb(readableStream[, options])`
29162928

29172929
<!-- YAML
@@ -3042,6 +3054,18 @@ A utility method for creating duplex streams.
30423054
* `Promise` converts into readable `Duplex`. Value `null` is ignored.
30433055
* Returns: {stream.Duplex}
30443056

3057+
If an `Iterable` object containing promises is passed as an argument,
3058+
it might result in unhandled rejection.
3059+
3060+
```js
3061+
const { Duplex } = require('node:stream');
3062+
3063+
Duplex.from([
3064+
new Promise((resolve) => setTimeout(resolve('1'), 1500)),
3065+
new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection
3066+
]);
3067+
```
3068+
30453069
### `stream.Duplex.fromWeb(pair[, options])`
30463070

30473071
<!-- YAML

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.