Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
/ rson Public archive

Inspect any JSON file from command line. Fast with huge files.

License

Notifications You must be signed in to change notification settings

pietrovismara/rson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Inspect any JSON file from command line. Fast with huge files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages