effect-io-ai

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

NodeStream.toUint8Array

Consumes a Node readable stream into a Uint8Array, using the same error mapping and maxBytes handling as toArrayBuffer.

Signature

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

Source

Since v4.0.0