JSONPath
A JavaScript library for querying, transforming, and extracting data from JSON documents using an extended JSONPath syntax.
Repository Health
Technical Analysis
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 raweval/Functionby 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
Artillery
Devops · Developer Tools
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.
Botpress
AI Assistants · AI Development · Customer Support
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.
FastGPT
AI Agents · AI Development
Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.
Fern
Developer Tools
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.
Label Studio
AI Development · Data Engineering
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.
Langfuse
AI Development · Monitoring
Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.
n8n
Automation · No Code Platforms
Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.
NocoBase
No Code Platforms · Low Code Platforms
Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.
OpenStatus
Monitoring · Devops
Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.