superagent-binary-parser

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i superagent-binary-parser

Weekly Downloads

3,511

Version

1.0.1

License

ISC

Last publish

Collaborators

  • tovazm