Skip to content

Instantly share code, notes, and snippets.

@BFinc
Forked from watson/jsonstream.js
Created June 24, 2018 14:57
Show Gist options
  • Save BFinc/988e40d1217f22b57b96db7f82daa511 to your computer and use it in GitHub Desktop.
Save BFinc/988e40d1217f22b57b96db7f82daa511 to your computer and use it in GitHub Desktop.
Example of using the JSONStream module
var request = require('request')
var JSONStream = require('JSONStream')
var opts = {
url: 'https://api.github.com/users/watson/repos',
headers: {'User-Agent': 'request'}
}
request(opts)
.pipe(JSONStream.parse('*'))
.on('data', function (data) {
console.log(data)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment