gron
gron copied to clipboard
ungron doesn't reproduce streamed JSON
Consider a multi-line "stream" JSON file:
{"one": 1}
{"two": 2}
{"three": 3}
Running gron -s on this file produces:
json = [];
json[0] = {};
json[0].one = 1;
json[1] = {};
json[1].two = 2;
json[2] = {};
json[2].three = 3;
Running gron -u and gron -u -s on that output produces:
[
{
"one": 1
},
{
"two": 2
},
{
"three": 3
}
]
Note that this was transformed into a JSON list. That makes sense with gron -u but it would be nice if gron -u -s understood this and produced a file that was semantically equivalent to the first one.
In addition, this would enable gron -u -s to output lines in a streaming fashion (as the flag implies). This would be great, since at the moment it's very easy to make gron -s large.jsonl | gron -u eat up all memory and die.
Try fastgron. It's much faster and also handles streaming in this way.