jp icon indicating copy to clipboard operation
jp copied to clipboard

Streaming Json Blobs

Open bitdivine opened this issue 8 years ago • 3 comments

Hello,

Thank you for this. On individual JSON blobs it works well.

I usually deal with streams of JSON bobs, usually one JSON blob per line, but as jp reads only the first blob and then exits I have to write a bash loop that runs a separate process on each blob as it comes in. Needles to say this is very slow, not to mention inconvenient.

What do you think of reading a stream of blobs from stdin? This behaviour can always be behind a flag to keep current behaviour in the probably rare case of users are making use of the fact that only the first blob is processed.

Best wishes, Max

bitdivine avatar Feb 08 '17 17:02 bitdivine

Now available in https://github.com/go-jsonfile/jp/releases/tag/v0.1.5

suntong avatar Jun 05 '21 22:06 suntong

Ah that is a fork, I didn't realise at first.

I have jmestpath/jp version 0.2.0, and it doesn't support the -s (stream) function yet.

candlerb avatar Feb 10 '22 21:02 candlerb

it's more than a fork @candlerb. Have you checked https://github.com/go-jsonfile/jp/releases/tag/v0.2.2 yet?

suntong avatar Feb 11 '22 21:02 suntong