diff --git a/doc/api/stream.md b/doc/api/stream.md index b3f487c4fbf6fb..4dbb84a7a6bb1f 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -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 unhandled rejection. + +```js +const { Readable } = require('node:stream'); + +Readable.from([ + new Promise((resolve) => setTimeout(resolve('1'), 1500)), + new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection +]); +``` + ### `stream.Readable.fromWeb(readableStream[, options])`