-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathajson
More file actions
20 lines (11 loc) · 570 Bytes
/
ajson
File metadata and controls
20 lines (11 loc) · 570 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ajson
> Executes JSONPath on JSON objects.
> More information: <https://github.com/spyzhov/ajson>.
- Read JSON from a file and execute a specified JSONPath expression:
ajson '{{$..json[?(@.path)]}}' {{path/to/file.json}}
- Read JSON from stdin and execute a specified JSONPath expression:
cat {{path/to/file.json}} | ajson '{{$..json[?(@.path)]}}'
- Read JSON from a URL and evaluate a specified JSONPath expression:
ajson '{{avg($..price)}}' '{{https://example.com/api/}}'
- Read some simple JSON and calculate a value:
echo '{{3}}' | ajson '{{2 * pi * $}}'