@jorgeferrero/stream-to-buffer
v2.0.6
Published
A promise based npm package that converts a node.js ReadStream to buffer
Downloads
22,510
Maintainers
Readme
Stream To Buffer
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