diff --git a/doc/api/stream.md b/doc/api/stream.md index 613a0b7c87a8d6..2d0103349121f6 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2890,6 +2890,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])`