dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.91k stars 165 forks source link

Support question - This module works too good for its own good #137

Closed ORESoftware closed 6 years ago

ORESoftware commented 7 years ago

I installed this thing and it's working for me. Specifically using it to pipe socket data

const client = net.createConnection(function(){
});

client.pipe(JSONStream()).on('data', d => {});

however, my question is - what is the purpose of this module - is it just a wrapper around the jsonparse package? Should I be using that one instead?

Sorry for the support question, but sometimes it's hard to figure out what the best module there is to use.

dominictarr commented 7 years ago

jsonpase does the parsing, but JSONStream gives you a more friendly interface. (allowing you to specify the path into the JSON structure) with jsonparse your one line of code will not be just one line anymore