Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 28x 28x 28x 28x 20x 20x 20x 20x 18x 20x 20x 20x 20x 17x 17x 20x 20x 20x 20x 28x | var Promise = require('bluebird'); var Stream = require('stream'); module.exports = function(entry) { return new Promise(function(resolve,reject) { var chunks = []; var bufferStream = Stream.Transform() .on('finish',function() { resolve(Buffer.concat(chunks)); }) .on('error',reject); bufferStream._transform = function(d,e,cb) { chunks.push(d); cb(); }; entry.on('error',reject) .pipe(bufferStream); }); }; |