1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-24 01:22:10 +02:00
tldr/pages/common/ajson.md
Vítor Henrique 5edbf734fb
pages*: improve page descriptions (#12558)
* pages*: improve page descriptions

* ical: improve page description

* cockpit-desktop: remove unneeded word from page description

* nc: improve description wording

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-04-25 19:58:21 -03:00

20 lines
579 B
Markdown

# ajson
> Execute 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 * $}}'`