0.0.5 • Published 10 years ago

j2ldj v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

SYNOPSIS

A very handy and narrowly scoped utility to take the output from JSONStream for piping into tools like jq.

Tools like jq will otherwise hang waiting.

Basically it takes

[\n
{"field": "value"}\n
,\n
{"field": "value"}\n
... lots and lots of objects ...
,\n
]\n

and makes it into:

{"field": "value"}\n
{"field": "value"}\n
... lots and lots of objects ...

motivation

Let's say you have a very large source of JSON, maybe it's in a file; maybe it's something sending data over an http connection and that data has been piped through JSONStream.

On the receiving end it looks like this:

[
{"field": "value"}
,
... lots and lots of objects ...
,
]

Now if you pipe this directly to jq it waits for the closing ] before it'll start outputting the stream.

This made me sad.

USAGE

npm install -g j2ldj
curl localhost/big_json_response | j2ldj | jq '.'
0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago