effect-io-ai

Package: @effect/platform-node-shared
Module: NodeStream

NodeStream.toArrayBuffer

Consumes a Node readable stream into an ArrayBuffer, failing through onError on stream errors or when maxBytes is exceeded and destroying the stream on interruption or failure.

Signature

declare const toArrayBuffer: <E = Cause.UnknownError>(readable: LazyArg<Readable | NodeJS.ReadableStream>, options?: { readonly onError?: (error: unknown) => E; readonly maxBytes?: SizeInput | undefined; }) => Effect.Effect<ArrayBuffer, E>

Source

Since v4.0.0