aboutsummaryrefslogtreecommitdiff
path: root/node_modules/superagent/lib/node/parsers/image.js
blob: b3e0ebc4bf01faf33c581a7bbd03febe13c2590c (plain) (blame)
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));
  });
};