Skip to main content

streamToBuffer

@webda/utils


Function: streamToBuffer()

streamToBuffer(stream): Promise<Buffer<ArrayBufferLike>>

Defined in: packages/utils/src/stream.ts:19

Collect all chunks from a Readable stream and concatenate them into a single Buffer.

Parameters​

stream​

Readable

The Readable stream to consume.

Returns​

Promise<Buffer<ArrayBufferLike>>

A Promise that resolves with the concatenated Buffer, or rejects on stream error.