ibm-cloud-sdk-core
Version:
Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.
56 lines (27 loc) • 952 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [streamToPromise](./ibm-cloud-sdk-core.streamtopromise.md)
## streamToPromise() function
Helper method that can be bound to a stream - it captures all of the results, and returns a promise that resolves to the final buffer or array of text chunks Essentially a smaller version of concat-stream wrapped in a promise
**Signature:**
```typescript
export declare function streamToPromise(stream: Stream): Promise<any>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
stream
</td><td>
Stream
</td><td>
optional stream param for when not bound to an existing stream instance.
</td></tr>
</tbody></table>
**Returns:**
Promise<any>
Promise