https://github.com/matthiasdiener/ripjson
A fast and lean way to grep in JSON files.
https://github.com/matthiasdiener/ripjson
grep json rust
Last synced: over 1 year ago
JSON representation
A fast and lean way to grep in JSON files.
- Host: GitHub
- URL: https://github.com/matthiasdiener/ripjson
- Owner: matthiasdiener
- License: mit
- Created: 2019-03-27T19:38:20.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T14:17:42.000Z (over 2 years ago)
- Last Synced: 2025-03-20T01:11:18.763Z (over 1 year ago)
- Topics: grep, json, rust
- Language: Rust
- Size: 37.1 KB
- Stars: 21
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ripjson
A fast and lean way to grep in JSON files.
## Installation
``` console
$ cargo install ripjson
```
## Usage
Usage: rj [options]
Options:
-i, --ignore-case Search case insensitively.
-s, --sensitive-case
Search case sensitively [default].
-h, --help Print this help menu.
-v, --version Print version.
--color Color output.
WHEN can be never, always, or auto [default].
Prints all JSON keys and values in `` whose keys match ``.
`` specifies for which JSON keys to search for. Separate path elements
with a `/`, e.g. `user/name`, similar to the JSON pointer syntax specfied in
https://tools.ietf.org/html/rfc6901.
## Example
``` console
$ cat test.json
{
"name": "John Doe",
"age": 43,
"address": {
"street": "10 Downing Street",
"city": "London"
},
"phones": [
"+44 1234567",
"+44 2345678"
]
}
$ rj '.*es.*' test.json
address/street = "10 Downing Street"
address/city = "London"
phones = "+44 1234567"
phones = "+44 2345678"
$ rj '.*es.*/cit' test.json
address/city = "London"
```