File size: 229 Bytes
0e27770
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
module.exports = function(res, fn){
  var data = []; // Binary data needs binary storage

  res.on('data', function(chunk){
      data.push(chunk);
  });
  res.on('end', function () {
      fn(null, Buffer.concat(data));
  });
};