https://github.com/jferrl/stream-to-buffer
A promise based npm package that converts a node.js ReadStream to buffer
https://github.com/jferrl/stream-to-buffer
js nodejs streaming typescript
Last synced: 10 months ago
JSON representation
A promise based npm package that converts a node.js ReadStream to buffer
- Host: GitHub
- URL: https://github.com/jferrl/stream-to-buffer
- Owner: jferrl
- License: mit
- Created: 2018-11-24T00:44:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T01:18:02.000Z (almost 2 years ago)
- Last Synced: 2025-08-04T03:39:12.915Z (10 months ago)
- Topics: js, nodejs, streaming, typescript
- Language: TypeScript
- Size: 6.37 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stream To Buffer
[](https://travis-ci.org/jferrl/stream-to-buffer)
[](https://codeclimate.com/github/jferrl/stream-to-buffer/maintainability)
[](https://codeclimate.com/github/jferrl/stream-to-buffer/test_coverage)


A promise based Node.js package that converts a Node.js Readable to buffer
## Installation
```sh
npm i @jorgeferrero/stream-to-buffer
```
## Usage
```typescript
import { streamToBuffer } from '@jorgeferrero/stream-to-buffer';
import * as fs from 'fs';
const data = await streamToBuffer(fs.createReadStream('./file'));
console.log(data.toString());
```
```sh
Output should be the the content of the file
```
## Test
```sh
npm run test
```