json-stream icon indicating copy to clipboard operation
json-stream copied to clipboard

Iterating over a JSON file

Open sagikazarmark opened this issue 10 years ago • 2 comments

First of all: this library is awesome.

Question: is it possible to create some sort of iterator based on this?

sagikazarmark avatar Jan 26 '15 01:01 sagikazarmark

thanks, I guess it's possible, but rewind will work just once :)

skolodyazhnyy avatar Jan 26 '15 08:01 skolodyazhnyy

Just as I thought. However I think adding a reset method would make sense which should do the following:

  • Reset the stream
  • Reset the tokenizer
  • Reset the token

Doing this would allow to reread the file without recreating the Reader/opening multiple streams to the same file.

Just in case you are interested: I am working on a JSON Reader/Writer for this package: https://github.com/ddeboer/data-import

sagikazarmark avatar Jan 26 '15 10:01 sagikazarmark