Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/saintedlama/request-parse-json
- Owner: saintedlama
- Created: 2015-07-25T11:09:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-19T08:03:20.000Z (about 9 years ago)
- Last Synced: 2024-10-30T00:51:32.518Z (14 days ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 nextfunction next(err, response, repository, body) {
// Do something...
}```