## streamToBuffer() function [​](/content/docs/sdk/core.streamtobuffer#streamtobuffer-function "Direct link to streamToBuffer(/index.html) function")

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

**Signature:**

```typescript
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<Buffer>

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

- [streamToBuffer() function](/content/docs/sdk/core.streamtobuffer#streamtobuffer-function/index.html)
- [Parameters](/content/docs/sdk/core.streamtobuffer#parameters/index.html)
