jq.node
jq.node copied to clipboard
Implement JSON input stream support
jq.node should support JSON lines and/or simply a stream of \n separated records.
Support this:
$ echo -e '{"foo": "bar"}\n{"baz": "qux"}' | jq '.'
{
"foo": "bar"
}
{
"baz": "qux"
}
A JS only workaround right now is to use https://www.npmjs.com/package/jsonlines2json
echo -e '{"foo": "bar"}\n{"baz": "qux"}' | jsonlines2json | jqn
There are a couple other jsonlines parsers I found on npm, but jsonlines2json is the only one I found with a CLI.
Perhaps initial support could be jq's --slurp option. We could just use the node API of jsonlines2json. Or we can look for another package