core.streamtobuffer | Medplum

streamToBuffer() function

Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.

Signature:

export declare function streamToBuffer(stream: Readable): Promise<Buffer>;

Parameters [​](/content/docs/sdk/core.streamtobuffer#parameters "Direct link to Parameters"/index.html)

Parameter Type Description
stream Readable The Readable stream to read from.

Returns:

Promise

A Promise that resolves with a Buffer containing all the data from the Readable stream.