#json-file #json #inspect #command #command-line

app dash

Inspect any JSON file using the command line. Fast with huge files.

1 unstable release

Uses old Rust 2015

0.1.0 Aug 26, 2017

#40 in #inspect

MIT license

16KB
383 lines

Setup

Debian/Ubuntu/Mint: Grab the .deb file from releases.

Any other OS: download and compile with rustc/cargo.

Usage

Prettify

file.json

{"bar":{"foo":true}}

commands

cat file.json | rson pretty

result

{
    "bar": {
        "foo": true
    }
}

Get object property value

file.json

{
    "foo": ["bar"]
}

commands

cat file.json | rson get foo.0

result

"bar"

Filter Number in Array

file.json

[0, 0, 0, 1, 0, 0]

commands

$ cat file.json | rson filter '$self,==,n:1'

result

[1]

Find Object in Array

file.json

[
    { "username": "armitage" },
    { "username": "molly" },
    { "username": "wintermute" }
]

commands

$ cat file.json | rson find 'username,==,s:molly' | rson pretty

result

{
    "username": "molly"
}

Check if every item in Array matches predicate

file.json

[
    { "verified": true },
    { "verified": false },
    { "verified": true }
]

commands

$ cat file.json | rson every 'verified,==,b:true'

result

false

Get Array length

file.json

[0, 0, 0, 0, 0, 0]

commands

$ cat file.json | rson length

result

6

Dependencies

~1.3–2MB
~35K SLoC