npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jsonpathx/jsonpathx

v0.1.6

Published

Modern, high-performance JSONPath library with RFC 9535 compliance and jsonpath-plus compatibility.

Readme

jsonpathx

Modern, high-performance JSONPath library with RFC 9535 compliance and jsonpath-plus compatibility

Docs CI License: MIT

Interactive JSONPath Playground 🛝

Try out JSONPath queries in your browser with the interactive playground: https://jsonpathx-playground.vercel.app/

Why jsonpathx? ⚡

jsonpathx is a next-generation JSONPath library that combines standards compliance with a practical, developer-friendly API. It is actively maintained and focused on real-world performance.

The motivation is driven by jsonpath and jsonpath-plus. Both libraries are no longer maintained, so jsonpathx exists to keep development alive, add new features, and make JSONPath tooling more robust.

  • RFC 9535 compliant - implements the official JSONPath standard
  • jsonpath-plus compatible - supports jsonpath-plus extensions and options
  • TypeScript-first - comprehensive type safety
  • Fluent builder API - chainable query composition
  • Multiple result formats - values, paths, pointers, parents, and more
  • Caching built in - LRU with TTL support

Installation 📦

npm install @jsonpathx/jsonpathx

Quick Start 🚀

Basic Usage ✨

import { JSONPath } from '@jsonpathx/jsonpathx';

const data = {
  store: {
    book: [
      { title: 'Sayings of the Century', price: 8.95 },
      { title: 'Moby Dick', price: 8.99 },
      { title: 'The Lord of the Rings', price: 22.99 }
    ],
    bicycle: { color: 'red', price: 19.95 }
  }
};

const titles = await JSONPath.query('$.store.book[*].title', data);
// ['Sayings of the Century', 'Moby Dick', 'The Lord of the Rings']

const cheapBooks = await JSONPath.query('$.store.book[?(@.price < 10)]', data);
// [{ title: 'Sayings of the Century', price: 8.95 }, { title: 'Moby Dick', price: 8.99 }]

const paths = await JSONPath.paths('$.store.book[*].title', data);
// ['$.store.book[0].title', '$.store.book[1].title', '$.store.book[2].title']

Fluent Builder API 🧩

import { JSONPath } from '@jsonpathx/jsonpathx';

const result = await JSONPath.create(data)
  .query('$.store.book[*]')
  .filter(book => book.price < 10)
  .sort((a, b) => a.price - b.price)
  .map(book => book.title)
  .take(5)
  .execute();
// ['Sayings of the Century', 'Moby Dick']

Type Selectors 🧪

const mixedData = {
  items: [1, "two", 3, "four", null, true, { key: "value" }, [1, 2]]
};

await JSONPath.query('$.items[?(@number())]', mixedData);
await JSONPath.query('$.items[?(@string())]', mixedData);
await JSONPath.query('$.items[?(@scalar())]', mixedData);

Extended Syntax ➕

jsonpathx implements all RFC 9535 features plus jsonpath-plus extensions like:

  • OR operator: $.store.book | $.store.bicycle
  • Grouping: $.store.(book, bicycle)
  • XPath-style filters: $..book[[email protected]<10].author

Performance 🏎️

See the benchmark results generated by the repo scripts (current suite shows jsonpathx leading most queries):

  • bench/results.md
  • apps/docs/bench.md

API Overview 🧭

JSONPath Class 🧱

await JSONPath.query(path, data, options)
await JSONPath.paths(path, data)
await JSONPath.pointers(path, data)
await JSONPath.parents(path, data)

JSONPath.create(data).query(path).filter(...).execute()

JSONPath.enableCache({ maxSize: 100, ttl: 60000 })
JSONPath.clearCache()
JSONPath.getCacheStats()

Result Types 🎯

resultType: 'value'
resultType: 'path'
resultType: 'pointer'
resultType: 'parent'
resultType: 'parentProperty'
resultType: 'all'

Documentation 📚

  • Guide and API docs are in apps/docs
  • Benchmarks: bench/results.md
  • Migration from jsonpath-plus: apps/docs/migration/from-jsonpath-plus.md

Development 🛠️

npm install
npm test
npm run bench
npm run docs:build

Contributing 🤝

See CONTRIBUTION.md for contribution guidelines.

License 📜

MIT License - see LICENSE.