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

Usage in Deno

```typescript import { ReadableBase } from "node:node__stream.d.ts"; ```
ReadableBase.prototype.iterator(options?: { destroyOnReturn?: boolean; }): AsyncIterableIterator<any>
The iterator created by this method gives users the option to cancel the destruction of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, or if the iterator should destroy the stream if the stream emitted an error during iteration.

Parameters

optional
options: { destroyOnReturn?: boolean; }

Return Type

AsyncIterableIterator<any>