@johngw/stream
Version:
Reactive programming tools using the WHATWG Streams API.
16 lines (15 loc) • 408 B
text/typescript
import { ToIteratorOptions } from '@johngw/stream/sinks/toIterator';
/**
* Turns a `ReadableStream` in to an `AsyncIterable`.
*
* @group Sinks
* @see {@link toArray:function}
* @see {@link toIterator}
* @example
* ```
* for await (const chunk of toIterable(stream)) {
*
* }
* ```
*/
export declare function toIterable<T>(stream: ReadableStream<T>, options?: ToIteratorOptions): AsyncIterable<T>;