https://github.com/berquerant/jsongrep
grep json by json
https://github.com/berquerant/jsongrep
rust
Last synced: about 1 year ago
JSON representation
grep json by json
- Host: GitHub
- URL: https://github.com/berquerant/jsongrep
- Owner: berquerant
- Created: 2021-07-08T16:47:32.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-08T16:48:02.000Z (almost 5 years ago)
- Last Synced: 2025-02-06T16:58:47.806Z (over 1 year ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jsongrep
Grep json.
## Usage
`jsongrep -h`
### Example
```shell
% (echo '{"s":"Sirius","i":0}';echo 'not json';echo '{"a":[]}';echo '{"s":1}';echo '{"s":"xirius"}';echo '{"s":"sirius"}') | jsongrep -r '{"query":{"type":"raw","pair":{"p":"/s","cond":{"type":"match","mtype":"regex","value":{"type":"string","value":"[sS]irius"}}}}}'
{"s":"Sirius","i":0}
line 2: expected ident at line 1 column 2
line 3: Invalid pointer (pointer: "/s", value: "{\"a\":[]}")
line 4: Matcher type mismatch (matcher_type "Regex", matcher_value "String([sS]irius)", target "Int(1)", by "&jsongrep::query::Condition")
{"s":"sirius"}
```
## Development
1. `cargo install --force cargo-make`
2. `cargo make dev`