let reduceStream = require('reduce-stream-to-promise')
function concat(acc, curr) {
return acc + curr;
}
reduceStream(concat, '', stream).then(result => console.log(result))
Ninju/reduce-stream-to-promise
Reduce a stream to a promise by the given reduction function
JavaScriptMIT