json-processing

2.0.3 • Public • Published

JP: JSON Processing Tool

Build Status via Travis CI NPM version Dependency Status via David DM

JP combines both yajson-stream and RxJS to provide a powerful command line tool for filtering and transforming json streams.

Example

Take the following ndjson as an example:

{ "num": 1 }
{ "num": 1 }
{ "num": 1 }

Then select all num and sum:

$ npm install -g json-processing
$ cat test.json | jp -l 'select(".num") |> reduce((a, b) => a + b, 0)' -m json
3

The -l parameter defines the filtering and transformation sequence. It must start with a call to select(path: string), which takes a yajson-stream path as parameter. The return is an Observable from RxJS.

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

LICENSE

Code and documentation released under The MIT License (MIT).

/json-processing/

    Package Sidebar

    Install

    npm i json-processing

    Weekly Downloads

    36

    Version

    2.0.3

    License

    MIT

    Unpacked Size

    102 kB

    Total Files

    93

    Last publish

    Collaborators

    • tsouza