1.0.1 • Published 4 years ago

simple-jsonpath v1.0.1

Weekly downloads
200
License
MIT
Repository
github
Last release
4 years ago

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:

JSONPathDescription
$.store.book[*].authorThe authors of all books in the store
$..authorAll authors
$.store.*All things in store, which are some books and a red bicycle
$.store..priceThe price of everything in the store
$..book[2]The third book
$..book[(@.length-1)]The last book via script subscript
$..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)]Filter all books with isbn number
$..book[?(@.price<10)]Filter all books cheaper than 10
$..book[?(@.price==8.95)]Filter all books that cost 8.95
$..book[?(@.price<30 && @.category=="fiction")]Filter all fiction books cheaper than 30
$..*All members of JSON structure

License

MIT