ynqa/jnv

Feature Request: Support JSON stream

icholy opened this issue ยท 8 comments

It would be nice if jnv supported sequences of json objects separate by newlines the way jq does:

{ "a": 123 }
{ "a": 123 }

Note: fx also supports this.

This would be really useful for inspecting Caddy logs.

Ditto useful for our use cases.

We're talking about JSON Lines, yes? https://jsonlines.org

@robpottify The objects are delimited by newlines, but jq allows a single object to span multiple lines:

{
  "a": 123
}
{
  "a": 321
}

edit: jq doesn't even require the newline:

{
  "a": 123
} {
  "a": 321
}

Ah ok, so subtly different as JSON Lines prescribes newlines between records.

Should I raise a separate gh issue ticket for JSON Lines, or are they similar enough to be prioritised as one feature?

@robpottify JSON lines is a subset of JSON streams.

ynqa commented

@icholy In #28, I've made it possible to handle multiple JSONs. Please check whether the problem addressed in this issue has been resolved.

@ynqa tested and working perfectly!

ynqa commented

@icholy Released v0.2.0 which addressed this issue. Please check it out ๐ŸŽ‰