method Stream.collect
Stream.collect(): Promise<T[]>

Collects all successful values emitted by the stream into an array. If any errors were collected during the stream processing, they will be thrown as an AggregateError containing all collected errors.

Return Type

Promise<T[]>

Throws

AggregateError

(ES2021 built-in) If any errors were collected during the stream processing.

Usage

import { type Stream } from ".";