superagent-binary-parser
v1.0.1
Published
binary parser for superagent
Downloads
14,506
Maintainers
Readme
superagent-binary-parser is a superagent plugin, created to parse binary response stream (pdf, zip, etc...)
Installation
npm install superagent-binary-parser --save
Usage
var binaryParser = require('superagent-binary-parser');
var superagent = require('superagent');
superagent.get("https://website.com/ressource.pdf")
.parse(binaryParser)
.buffer()
.end(function(err, resp) {
//resp.body is the buffer
fs.writeFileSync("./resp.pdf", resp.body)
})