Skip to main content
ReadableBase.from - node__stream.d.ts - Node documentation
method ReadableBase.from

Usage in Deno

```typescript import { ReadableBase } from "node:node__stream.d.ts"; ```
ReadableBase.from(
iterable: Iterable<any> | AsyncIterable<any>,
options?: ReadableOptions,
): Readable
A utility method for creating Readable Streams out of iterators.

Parameters

iterable: Iterable<any> | AsyncIterable<any>
Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed.
optional
options: ReadableOptions
Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`.

Return Type

Readable