2.0.6 • Published 3 years ago

@jorgeferrero/stream-to-buffer v2.0.6

Weekly downloads
533
License
MIT
Repository
github
Last release
3 years ago

Stream To Buffer

Build Status Maintainability Test Coverage npm npm (scoped)

A promise based Node.js package that converts a Node.js Readable to buffer

Installation

npm i @jorgeferrero/stream-to-buffer

Usage

import { streamToBuffer } from '@jorgeferrero/stream-to-buffer';
import * as fs from 'fs';

const data = await streamToBuffer(fs.createReadStream('./file'));
console.log(data.toString());
Output should be the the content of the file

Test

npm run test