Last active
July 11, 2018 19:13
-
-
Save watson/802d9ac6b392ab422d353719d90c09eb to your computer and use it in GitHub Desktop.
Example of using the JSONStream module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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