stream-to-json

Deserialize JSON from a stream

stream-to-json

Deserialize JSON from a stream

var toJSON = require('stream-to-json');
var request = require('request');
 
toJSON(request('/some/url.json'), function(errjson) {
  if (err) throw err;
  console.log(json);
});

Read all from stream, then JSON.parse and call fn with the result. If there's an Error in the stream itself, or parsing the JSON, an error will be passed.

$ npm install stream-to-json

MIT