1.0.1 • Published 7 years ago

superagent-binary-parser v1.0.1

Weekly downloads
3,394
License
ISC
Repository
github
Last release
7 years ago

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)
	})