Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Superagent plugin for parsing binary response stream (pdf, zip, etc...)

Notifications You must be signed in to change notification settings

abelcha/superagent-binary-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

superagent-binary-parser is a superagent plugin, created to parse binary response stream (pdf, zip, etc...)

Installation

npm install superagent-binary-parser --save

Usage

const binaryParser = require('superagent-binary-parser');
const superagent = require('superagent');

superagent.get('https://philosophiatopics.files.wordpress.com/2018/10/skin-in-the-game-nassim-nicholas-taleb.pdf')
	.parse(binaryParser)
	.buffer()
	.end((err, resp) => {
		//resp.body is a buffer
		fs.writeFileSync('./resp.pdf', resp.body)
	})

About

Superagent plugin for parsing binary response stream (pdf, zip, etc...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •