Skip to content

Instantly share code, notes, and snippets.

@watson
Last active July 11, 2018 19:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save watson/802d9ac6b392ab422d353719d90c09eb to your computer and use it in GitHub Desktop.
Save watson/802d9ac6b392ab422d353719d90c09eb 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