aboutsummaryrefslogtreecommitdiff
path: root/node_modules/superagent/lib/node/parsers/image.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/superagent/lib/node/parsers/image.js')
-rw-r--r--node_modules/superagent/lib/node/parsers/image.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/superagent/lib/node/parsers/image.js b/node_modules/superagent/lib/node/parsers/image.js
new file mode 100644
index 0000000..b3e0ebc
--- /dev/null
+++ b/node_modules/superagent/lib/node/parsers/image.js
@@ -0,0 +1,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));
+ });
+}; \ No newline at end of file