{"id":25979245,"url":"https://github.com/bjorg/jpath","last_synced_at":"2026-06-08T05:31:36.101Z","repository":{"id":66875539,"uuid":"1151968","full_name":"bjorg/jPath","owner":"bjorg","description":"XPath for JSON","archived":false,"fork":false,"pushed_at":"2011-06-18T01:59:26.000Z","size":3676,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-11T19:06:21.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bluelinecity.com/software/jpath/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-09T04:23:50.000Z","updated_at":"2018-05-14T08:45:30.000Z","dependencies_parsed_at":"2023-02-20T13:30:26.606Z","dependency_job_id":null,"html_url":"https://github.com/bjorg/jPath","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bjorg/jPath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjorg%2FjPath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjorg%2FjPath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjorg%2FjPath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjorg%2FjPath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjorg","download_url":"https://codeload.github.com/bjorg/jPath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjorg%2FjPath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34050225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-05T06:29:00.784Z","updated_at":"2026-06-08T05:31:36.086Z","avatar_url":"https://github.com/bjorg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"JPath\n=====\n*XPath for JSON*\n\n**NOTE**: I'm no longer maintaining this code.  Look at [jDoc](https://github.com/bjorg/jdoc) instead, which provides similar functionality.\n\nJPath is a simple lightweight Javascript Class which provides an XPath-like querying ability to JSON objects.\n\nFeatures\n--------\n* basic node selection\n* element index selection\n* unlimited, nested predicate selections via inline javascript functions\n* 2 methods of querying, chained javascript functions or traditional XPath query string\n* root, parent, global node selections\n* predicate functions [ last(), position(), count() ]\n* boolean operators\n\nUsing JPath\n-----------\nThere are two syntactic methods to using JPath - chained method calls or an XPath query.\n\nChained method calls offers the most control but with a high level of complexity. \nXPath query is a lot easier to use but with the caveat that it's considered beta \nand rather limited as far as Javascript features go.\n\nUsage\n-----\n\tvar jpath = new JPath( myjsonobj );\n \tvar somevalue = jpath.$('book/title').json;  //results in title\n\t\t//or\n\tvar somevalue = jpath.query('book/title');   //results in title\n\nSupported XPath-like Syntax:\n\t/tagname\n\t//tagname\n\ttagname\n\t* wildcard\n\t[] predicates\n\toperators ( \u003e=, ==, \u003c= )\n\tarray selection\n\t.. \t         \n\t*\n\tand, or\n\tnodename[0]\n\tnodename[last()]\n\tnodename[position()]\n\tnodename[last()-1]\n\tnodename[somenode \u003e 3]/node\n\tnodename[count() \u003e 3]/node\n\nCompatibility\n-------------\n* Firefox 2-3\n* IE 6-7\n* Chrome\n\nUpdate Log\n----------\n1.0.1\n        Bugfix for zero-based element selection\n\n1.0.2\n        Bugfix for IE not handling eval() and returning a function\n\n1.0.3 - Bugfix added support for underscore and dash in query() function\n        Bugfix improper use of Array.concat which was flattening arrays\n        Added support for single equal sign in query() function\n        Added support for count() xpath function\n        Added support for and, or boolean expression in predicate blocks\n        Added support for global selector $$ and //\n        Added support for wildcard (*) selector support\n         \n1.0.4\n        Changed to MIT license\n1.0.5\n        Added jPath as alias to JPath\n        Using $.extend to extend jPath prototype\n        Moved initalizing into a function closure\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjorg%2Fjpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjorg%2Fjpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjorg%2Fjpath/lists"}