simple-jsonpath
Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.
This is a fork from jsonpath. Please, go to the original README to get a full documentation.
The main goal of this fork is to reduce the jsonpath bundle size from 83.7KB to 38.3KB by getting rid of some expression/script rules.
Concretely, I removed script expression and filters:
JSONPath | Description |
---|---|
$.store.book[*].author |
The authors of all books in the store |
$..author |
All authors |
$.store.* |
All things in store, which are some books and a red bicycle |
$.store..price |
The price of everything in the store |
$..book[2] |
The third book |
$..book[(@.length-1)] |
|
$..book[-1:] |
The last book via slice |
$..book[0,1] |
The first two books via subscript union |
$..book[:2] |
The first two books via subscript array slice |
$..book[?(@.isbn)] |
|
$..book[?(@.price<10)] |
|
$..book[?(@.price==8.95)] |
|
$..book[?(@.price<30 && @.category=="fiction")] |
|
$..* |
All members of JSON structure |