Stream-Promise is a Node.js stream to Promise conversion module.
npm install --save sb-stream-promise
export default function createStreamPromise(stream: Stream, bytesLimit: ?number)const FS = require('fs')
const createStreamPromise = require('sb-stream-promise')
createStreamPromise(FS.createReadStream(`/etc/passwd`))
.then(function(contents) {
console.log(contents)
})
.catch(function(error) {
console.error('unable to read file', error)
})This project is licensed under the terms of MIT License. See the LICENSE file for more info.