jq.node icon indicating copy to clipboard operation
jq.node copied to clipboard

Implement JSON input stream support

Open FGRibreau opened this issue 8 years ago • 1 comments

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"
}

FGRibreau avatar Dec 05 '16 13:12 FGRibreau

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

dosentmatter avatar Apr 24 '20 01:04 dosentmatter