JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42046
  • Score
    100M100P100Q150368F
  • License BSD

Streaming JSON filtering on the command line

Package Exports

  • jsonfilter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsonfilter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jsonfilter

Streaming JSON filtering on the command line.

Works great for JSON datasets that are too big to JSON.parse() or for situations where you want to start reading data immediately.

Powered by JSONStream which is powered by jsonparse

NPM

usage

Pipe JSON data to stdin!

jsonfilter <filter>

filter is a string to 'query' your JSON with.

Matches will be printed as Newline Delimited JSON (NDJSON)

some examples:

rows.* matches any child elements of rows, e.g.:

$ echo '{"rows": [ {"this object", "will be matched"}, {"so will": "this one"} ]}' | jsonfilter "rows.*"
{"this object", "will be matched"}
{"so will": "this one"}

rows.*.doc matches all children of rows with key doc, e.g.:

$ echo '{"rows": [ {doc: {'this object': 'will be matched'}, foo: "bar"} ]}' | jsonfilter "rows.*.doc"
{'this object': 'will be matched'}

rows..doc recursively matches all children of rows and emits all with key doc, e.g.:

$ echo '{"rows": [ {"foo": {"bar": {"baz": {"taco": {"doc": "woo"}}}}} ]}' | jsonfilter "rows..doc"
"woo"