dominictarr / JSONStream

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

Is it possible to use this for a seeking stream? #80

Open dbkaplun opened 8 years ago

dbkaplun commented 8 years ago

I would like to jump around in a file, possibly into the middle of a JSON structure. Is it possible to use or adapt JSONStream to seek around in a file?

dominictarr commented 8 years ago

Unfortunately that isn't possible in json. You won't know where you are in the tree. However, if you control the json, you could instead use line delimited json and then you could seek by line breaks.

But the better question is what it this data and what are you doing with it? On Nov 4, 2015 7:54 AM, "Dan Kaplun" notifications@github.com wrote:

I would like to jump around in a file, possibly into the middle of a JSON structure. Is it possible to use or adapt JSONStream to seek around in a file?

— Reply to this email directly or view it on GitHub https://github.com/dominictarr/JSONStream/issues/80.