json:select()
CSS-like selectors for JSON.
{ "author": { "name": { "first": "Lloyd", "last": "Hilaiel" }, "drinkPref": [ "whiskey", "beer", "wine" ], }, "thing": "JSONSelect site", "license": "(cc) BY-SA" }
JSONSelect is an experimental selector language for JSON.
It makes it easy to access data in complex JSON documents.
It feels like CSS.
Why not give it a try?
{ "name": { "first": "Lloyd", "last": "Hilaiel" }, "favoriteColor": "yellow", "languagesSpoken": [ { "language": "Bulgarian", "level": "advanced" }, { "language": "English", "level": "native" }, { "language": "Spanish", "level": "beginner" } ], "seatingPreference": [ "window", "aisle" ], "drinkPreference": [ "whiskey", "beer", "wine" ], "weight": 172 }
JSONSelect is dedicated to sad code everywhere that looks like this:
if (foo && foo.bar && foo.bar.baz && foo.bar.baz.length > 2) return foo.bar.baz[2]; return undefined;
It was created by Lloyd Hilaiel.
Dave Herman provided the name, and lots of encouragement.
Mike Hanson gave deep feedback and ideas.
John Resig unwittingly contributed his design thoughts.
The jsonselect.org site design was inspired by Stephen Wildish.
JSON and CSS3 Selectors are the prerequisites to JSONSelect's existence, so thanks to you guys too.