Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cosmo-ray/json-search
Small utile to search trough json.
https://github.com/cosmo-ray/json-search
json
Last synced: about 1 month ago
JSON representation
Small utile to search trough json.
- Host: GitHub
- URL: https://github.com/cosmo-ray/json-search
- Owner: cosmo-ray
- License: wtfpl
- Created: 2021-01-02T12:37:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-28T21:32:18.000Z (over 1 year ago)
- Last Synced: 2024-08-02T02:07:32.736Z (4 months ago)
- Topics: json
- Language: C
- Homepage:
- Size: 292 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-json - json-search - A small tool to search for objects/values in json files. (Command-line tools)
README
small program that allow to search json files.
# dependancies
```
json-c libc
```# download:
on linux you have the appimages here: https://github.com/cosmo-ray/json-search/tags
# install:
Arch:
```
yay -S json-search-git
```Macos:
```
brew tap cosmo-ray/oui
brew install cosmo-ray/oui/json-search
```# usage:
```
json-search [OPTION] [NEEDLE] [FILES]
```
```
# options:
-v: verbose mode
-i: case insensitive
-V: Check Value instead of keys
-K: Print only objects keys
-R: raw print
-M NUM: limitate the number of returned objects
-P: print parent instead of element
-s: locate sub-string instead of strict comparison
ex: 'file' will match with 'files'
-r: recursive file search, NOT YET IMPLEMENTED
-o: multiple patern search
-t: look for object child, NOT YET IMPLEMENTED
-l: location info: print file and key
-h: are you really wondering what this is ?
```
But really just use
```sh
json-search -h
```
It's more updated than this readme# example:
```
$cat little-space.json:
{
"name" : "little-space",
"pre-load" : [
{ "file" : "html5-emu.js", "type" : "js" },
],
"init-scripts" : [
["js", "js_emu_init"]
],
"make-prototype": "jumper",
"starting widget" : "little-space",
"little-space" : {
"": "html-emu",
"dmod": "little-space",
"files": [
"js/funtions/Normes.js",
"js/define/display.js",
"js/define/input.js"
]
}
}$ json-search files little-space.json # "cat little-space.json | json-search files" work too
../little-space/start.json: [
"js/funtions/Normes.js",
"js/define/display.js",
"js/define/input.js"
]
```# TODO:
* Handle whildcards
* Fix not implemented options
* add one option to add a maximum deep in search# F.A.Q
Q: So it's just a cheap version of JQ
A: yes, like grep is a cheap version of sed, this tool try to be a simpler but easier to use version of jq that focus only on finding elements in json.