Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: duplex and readable from uncaught exception #46135

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions doc/api/stream.md
Expand Up @@ -2914,6 +2914,18 @@ Calling `Readable.from(string)` or `Readable.from(buffer)` will not have
the strings or buffers be iterated to match the other streams semantics
for performance reasons.

If an `Iterable` object containing promises is passed as an argument,
it might result in uncaught rejections.

```js
const { Readable } = require('node:stream');

Readable.from([
new Promise((resolve) => setTimeout(resolve('1'), 1500)),
new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Uncaught rejection
]);
```

### `stream.Readable.fromWeb(readableStream[, options])`

<!-- YAML
Expand Down Expand Up @@ -3044,6 +3056,18 @@ A utility method for creating duplex streams.
* `Promise` converts into readable `Duplex`. Value `null` is ignored.
* Returns: {stream.Duplex}

If an `Iterable` object containing promises is passed as an argument,
it might result in uncaught rejections.

```js
const { Duplex } = require('node:stream');

Duplex.from([
new Promise((resolve) => setTimeout(resolve('1'), 1500)),
new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Uncaught rejection
]);
```

### `stream.Duplex.fromWeb(pair[, options])`

<!-- YAML
Expand Down