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

Usage in Deno

```typescript import { ReadableBase } from "node:node__stream.d.ts"; ```
ReadableBase.prototype.toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>
This method allows easily obtaining the contents of a stream. As this method reads the entire stream into memory, it negates the benefits of streams. It's intended for interoperability and convenience, not as the primary way to consume streams.

Parameters

optional
options: Pick<ArrayOptions, "signal">

Return Type

Promise<any[]>
a promise containing an array with the contents of the stream.