Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement JSON input stream support #6

Open
FGRibreau opened this issue Dec 5, 2016 · 1 comment
Open

Implement JSON input stream support #6

FGRibreau opened this issue Dec 5, 2016 · 1 comment

Comments

@FGRibreau
Copy link
Owner

FGRibreau commented Dec 5, 2016

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"
}
@dosentmatter
Copy link

dosentmatter commented Apr 24, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants