JSONPath

A JavaScript library for querying, transforming, and extracting data from JSON documents using an extended JSONPath syntax.

Library
npm
v10.4.0
1,158stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
72/100Good
Development Activity72
Maintenance56
Community72
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture78
Code Quality82
Innovation74
Learning Curve85

jsonpath-plus (published on npm as jsonpath-plus, developed under the JSONPath-Plus org on GitHub) is a JavaScript implementation of JSONPath that extends Stefan Goessner’s original specification with additional operators and clearer semantics. Beyond standard path matching, it adds parent (^) and property-name (~) selectors, a full set of typed selectors (@string(), @number(), @scalar(), and more), and shorthand selectors like @path/@parent usable inside filter expressions.

Queries can return matched values, their absolute paths, JSON Pointers, parent objects, or parent property names, and filter expressions are evaluated through a sandboxed, jsep-based scripting layer that blocks prototype-pollution and Function-constructor escapes by default. The package ships ESM, CommonJS, and browser UMD builds along with a small CLI, and while actively used, the maintainers note in the README that the project is no longer under active feature development — only well-documented PRs and simple maintenance updates are considered.

What You Get

  • A single JSONPath() function (or instantiable class) implementing the original Goessner JSONPath spec plus extensions (^, ~, typed selectors, escaping)
  • Five result-type modes (value, path, pointer, parent, parentProperty, or all of them at once) selectable per query
  • A safety-conscious filter-expression evaluator (jsep-based SafeScript) with configurable eval modes, avoiding raw eval/Function by default
  • Prebuilt ESM/CJS/browser-UMD bundles plus a CLI binary for shell-based querying

Common Use Cases

  • Extracting nested values from JSON API responses
  • Querying JSON files from the command line via the bundled CLI
  • Locating and rewriting matched paths in JSON documents for transformation pipelines
  • Converting between JSONPath strings, path arrays, and JSON Pointers

Under The Hood

Architecture The library splits its entry points by platform: src/jsonpath.js holds the core JSONPathClass evaluator with a shared parsing/caching layer (pathCache, scriptCache), src/jsonpath-node.js attaches Node’s vm.Script to the class for native filter-expression evaluation, and src/jsonpath-browser.js binds a browser-safe scripting engine instead, with per-target ESM/CJS/browser-UMD bundles produced under dist/ via Rollup. Filter expressions (?()) are parsed and evaluated through Safe-Script.js, a jsep-based AST evaluator that blocks access to Function constructors and prototype-polluting properties before executing dynamic script fragments — a compiled, sandboxed scripting layer sitting behind the core path-matching engine. bin/jsonpath-cli.js is a thin CLI wrapper reusing the same Node evaluator. Changing the core recursive-descent matching algorithm in jsonpath.js would ripple into every entry point since they all wrap the same class.

Tech Stack JavaScript (ESM-first, "type": "module"), targeting Node >=18. Runtime dependency on jsep (a lightweight expression parser) plus its @jsep-plugin/assignment and @jsep-plugin/regex plugins for filter-expression syntax. Build tooling is Rollup 4 with plugin-babel/node-resolve/terser producing ESM, CommonJS, and browser UMD bundles; TypeScript (tsc) is used only to emit .d.ts declaration files from JSDoc-typed source rather than as the primary source language. Testing uses Mocha + Chai with c8 coverage, linting via ESLint (eslint-config-ash-nazg), and CI runs through GitHub Actions.

Code Quality Extensive dedicated Mocha test files cover path expressions, escaping, callbacks, safe-eval sandboxing, type operators, and CLI behavior, run through c8 for coverage with a generated coverage badge, plus a tsc pass and an “Are The Types Wrong” check to validate published type definitions. Errors are handled explicitly — Safe-Script.js throws on blocked constructs rather than silently ignoring them, and the CLI wraps JSON parsing in try/catch with clear usage output. Code is authored as plain JavaScript with abundant JSDoc type annotations feeding the declaration-file generation, rather than native TypeScript. ESLint and CI enforce style and run the full suite on every change.

API Design The public API is a single JSONPath({path, json, ...}) call (or a positional shorthand) that returns matches directly — no class instantiation required for the common case — while still exposing an instantiable class (autostart: false) for repeated evaluations with cached parsed paths/scripts. Options like resultType, wrap, and eval give fine-grained control over output shape and script-evaluation safety without extra dependencies, and static helpers (toPathArray, toPathString, toPointer) cover common path-format conversions. Getting started requires only an import plus one function call, though the breadth of options (five eval modes, meta-selector operators like ^/~) adds a documentation surface a newcomer must skim before using advanced filters.

Used by 13 apps in this directory

TypeScript
49%
MPL 2.0

Artillery

Devops · Developer Tools

9,071

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
88
Repo Health
73
Technical
68
Dependency
Built with
TypeScript49%
JavaScript48%
Updated 1 weeks ago
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,893

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript100%
Updated 3 days ago
TypeScript
89%
Other

FastGPT

AI Agents · AI Development

29,591

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
69
Dependency
Built with
TypeScript89%
Updated yesterday
TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,772

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript75%
Updated yesterday
TypeScript
38%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,222

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
TypeScript38%
JavaScript27%
Python25%
Updated today
TypeScript
98%
Other

Langfuse

AI Development · Monitoring

34,264

Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
92%
Other

n8n

Automation · No Code Platforms

203,555

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
66
Dependency
Built with
TypeScript92%
Updated today
TypeScript
99%
Other

NocoBase

No Code Platforms · Low Code Platforms

24,071

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript99%
Updated today
TypeScript
81%
AGPL 3.0

OpenStatus

Monitoring · Devops

9,072

Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.

View details
77
Repo Health
82
Technical
69
Dependency
Built with
TypeScript81%
MDX15%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search