CLI should process consecutive JSONs
Author: juriadCreated May 30, 2024Updated Jun 25, 2024
Labelsenhancement :+1:
The CLI should support (by default or behind a flag) processing multiple consecutive JSONs. This is inspired by jq that allows just that.
When I have have a stream of JSONs, I can process them all in jq - think of logs or cat *.json:
$ echo '{"a": 1} [1,2,3] 42 false null "alpha"' | jq
{
"a": 1
}
[
1,
2,
3
]
42
false
null
"alpha"However if they are JSON5 format, I cannot use json5 as a filter before they reach jq (I would expect the same result as above):
$ echo '{a: 1} [1,2,3,] 0x2A false/* not true */ null '\'alpha\' | json5 | jq
JSON5: invalid character '[' at 1:8Source: json5/json5