tomnomnom / gron

Make JSON greppable!
MIT License
13.73k stars 325 forks source link

Adds a slurp mode for reading the full file #91

Open rjp opened 2 years ago

rjp commented 2 years ago

Using the slurp option -- -S, -slurp -- causes gron to read all the data into RAM before processing. Tested on a 102M JSON file - memory usage is about 400M for parsing the first object.

Fixes #70 (in a fairly sledgehammer way, I suppose, but it's easier for people to deal with "read the whole file" than try to guess a number for a buffer size, especially if you don't know the file size in advance.)

Tests pass but linting doesn't but then agan linting also doesn't pass on the unmodified master either because gometalint is broken these days.