jpl
v0.1.1
Published
Command line JSON parser, processor
Downloads
3
Readme
jpl
Command line JSON parser, processor
Installation
Note: jpl
requires requires Node.js v8.0.0 or later.
npm install -g jpl
Usage
$ jpl --help
Usage: jpl [options]
Options:
-V, --version output the version number
-c, --code <code> Function to execute to parse JSON
-h, --help output usage information
Examples
Parse JSON and Format
$ < example.json | jpl
{
"data": [
{
"foo": "bar",
"bar": "foo"
},
{
"foo": "foobar",
"bar": "barfoo"
},
{
"bar": "foo"
}
]
}
Process parsed JSON with JavaScript function
$ < example.json | jpl -c "({ data }) => data.filter(({ foo }) => foo)"
[
{
"foo": "bar",
"bar": "foo"
},
{
"foo": "foobar",
"bar": "barfoo"
}
]