Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saintedlama/request-parse-json

Simple module to parse response from request module as JSON
https://github.com/saintedlama/request-parse-json

Last synced: about 15 hours ago
JSON representation

Simple module to parse response from request module as JSON

Awesome Lists containing this project

README

        

# request-parse-json

Simple module to parse response from request module as JSON.

# Installation

> npm install request-parse-json --save

# Usage

```javascript
var request = require('request');
var parseJSON = require('request-parse-json');

request({
method : 'GET',
url : 'https://api.github.com/repos/saintedlama/request-parse-json',
headers : {
'Accept' : 'application/vnd.github.v3+json',
'User-Agent' : 'request-parse-json'
}
}, parseJSON(next)); // Pass err, response, parsed body and raw body to next

function next(err, response, repository, body) {
// Do something...
}

```