convert-stream
1.0.2 • Public • Published convert-stream
Converts any stream to buffer or an array. Saves you from the trouble of saveing the streams to files.
Features
- Fast
- Promises implementation
Requirements
Before using gifme, please install:
Installation
For local
npm install convert-stream --save
Usage
For converting to Buffer
const cs = require('convert-stream');
const fs = require('fs');
const path = require('path');
let input = path.join(__dirname, 'yourexamplefile');
let yourStream = fs.createReadStream(input);
cs.toBuffer(yourStream)
.then((returnedBuffer) => { })
.catch(err, function doSomthingWithError(error) { });
For converting to array
cs.toArray(yourStream)
.then((returnedArray) => { })
.catch(err, function doSomthingWithError(error) { });
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.0.2
1,038
Version History
Package Sidebar
Install
Weekly Downloads