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

Support for JSON Lines #7

Closed
mlucool opened this issue Dec 20, 2016 · 4 comments
Closed

Support for JSON Lines #7

mlucool opened this issue Dec 20, 2016 · 4 comments

Comments

@mlucool
Copy link

mlucool commented Dec 20, 2016

Hi,

I would like to request that jq.node support JSON lines or simply a stream of \n separated records.

jq has support for this as follows:

$ echo -e '{"foo": "bar"}\n{"baz": "qux"}' | jq '.'
{
  "foo": "bar"
}
{
  "baz": "qux"
}

While jq.node (aliased to jqn) has an error:

$ echo -e '{"foo": "bar"}\n{"baz": "qux"}' | jqn
undefined:2
{"baz": "qux"}
^

SyntaxError: Unexpected token { in JSON at position 15

This support is very useful for things like bunyan style logs.

Thanks in advance for looking!

@FGRibreau
Copy link
Owner

Hello @mlucool, indeed, your issue is a duplicate of #6 :)

I will happily accept a PR for it! Closing

@mlucool
Copy link
Author

mlucool commented Dec 20, 2016

Lol we even had the same example....maybe I should read the other issues next time

@FGRibreau
Copy link
Owner

@mlucool the issue did not had a description when you posted yours, I just copy/pasted yours and adapted it, so thanks haha ^^

@mlucool
Copy link
Author

mlucool commented Dec 21, 2016

👍

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