Skip to content

marianoguerra/jsonpath.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jsonpath.js

a modern and tested js implementation of jsonpath (http://goessner.net/articles/JsonPath/)

status

for now the only supported parts are:

  • selecting from the root (expressions that start with $.)
  • attribute traversing using the dot syntax ($.a.b, not a['b'])
  • wildcard ($.a.*.b)

this is because those are the main things I need right now, others will be added when I need them or I have more time (or you fork and contribute :)

things to implement in (my) order of importance

  • array selector with [] ($.a[2].b)
  • attribute selector with [] ($['a']['b'])
  • array slice operator ($.a[1:7:-1])
  • basic filters ($.store.book[?(@.price < 10)])
  • recursive descent ($..book)

things I won't implement

  • arbitrary script expression

TODO

  • migrate jsonpath parsing to jison?
  • have the tests in a json file to be shared with other jsonpath implementations

author

marianoguerra

license

MIT

About

modern and tested jsonpath implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published