# json-p3

> JSONPath, JSON Pointer and JSON Patch

Latest version **3.0.1** (published 2026-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-p3
pnpm add json-p3
yarn add json-p3
bun add json-p3
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2026-10-09 |
| First published | 2023-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 469.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | James Prior |
| Maintainers | jg-rp |
| Keywords | JSON, JSON Patch, JSON Pointer, JSONPath |

## Links

- npm: https://www.npmjs.com/package/json-p3
- Repository: https://github.com/jg-rp/json-p3
- Issues: https://github.com/jg-rp/json-p3/issues
- npm.io page: https://npm.io/package/json-p3

## Dependencies (1)

- [iregexp-check](https://npm.io/package/iregexp-check.md) ^0.1.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.0.1 (latest) — 2026-10-09
- 3.0.0 — 2026-10-02
- 2.3.2 — 2026-09-22
- 2.3.1 — 2026-09-16
- 2.3.0 — 2026-09-01
- 2.2.2 — 2025-03-18
- 2.2.1 — 2025-02-23
- 2.2.0 — 2025-02-18
- 2.1.1 — 2025-01-30
- 2.1.0 — 2025-01-23
- 2.0.0 — 2024-12-26
- 1.3.5 — 2024-12-04
- 1.3.4 — 2024-08-05
- 1.3.3 — 2024-05-21
- 1.3.2 — 2024-05-16
- … 13 more at https://npm.io/package/json-p3/versions

## README

<h1 align="center">JSON P3</h1>

<p align="center">
JSONPath, JSON Patch and JSON Pointer for JavaScript.
<br>
We follow <a href="https://datatracker.ietf.org/doc/html/rfc9535">RFC 9535</a> and test against the <a href="https://github.com/jsonpath-standard/jsonpath-compliance-test-suite">JSONPath Compliance Test Suite</a>.
</p>

<p align="center">
  <a href="https://github.com/jg-rp/json-p3/blob/main/LICENSE">
    <img alt="LICENSE" src="https://img.shields.io/npm/l/json-p3?style=flat-square">
  </a>
  <a href="https://github.com/jg-rp/json-p3/actions">
    <img src="https://img.shields.io/github/actions/workflow/status/jg-rp/json-p3/tests.yaml?branch=main&label=tests&style=flat-square" alt="Tests">
  </a>
  <a href="https://www.npmjs.com/package/json-p3">
    <img alt="NPM" src="https://img.shields.io/npm/v/json-p3?style=flat-square">
  </a>
  <img alt="npm type definitions" src="https://img.shields.io/npm/types/json-p3?style=flat-square">
</p>

---

## Links

- Docs: https://jg-rp.github.io/json-p3/
- Install: https://jg-rp.github.io/json-p3/#install
- JSONPath playground: https://jg-rp.github.io/json-p3/playground
- JSONPath syntax: https://jg-rp.github.io/json-p3/guides/jsonpath-syntax
- API reference: https://jg-rp.github.io/json-p3/api
- Change log: https://github.com/jg-rp/json-p3/blob/main/CHANGELOG.md
- NPM: https://www.npmjs.com/package/json-p3
- Issue tracker: https://github.com/jg-rp/json-p3/issues

## Example

```javascript
import { jsonpath } from "json-p3";

const expr = "$.users[?@.status == 'pending'].name";

const data = {
  users: [
    { id: "usr_101", name: "Alice", status: "pending" },
    { id: "usr_102", name: "Bob", status: "active" },
    { id: "usr_103", name: "Charlie", status: "pending" },
  ],
};

const nodes = jsonpath.find(expr, data);

console.log(nodes.map((n) => n.value)); // [ "Alice", "Charlie" ]
console.log(nodes.map((n) => n.location)); // [ [ "users", 0, "name" ], [ "users", 2, "name" ] ]
console.log(nodes.map((n) => n.normalizedPath())); // [ "$['users'][0]['name']", "$['users'][2]['name']" ]
console.log(nodes.map((n) => n.shorthandPath())); // [ "$.users[0].name", "$.users[2].name" ]
console.log(nodes.map((n) => n.pointer.toString())); // [ "/users/0/name", "/users/2/name" ]
```

## Contributing

Please see [Contributing to JSON P3](https://github.com/jg-rp/json-p3/blob/main/CONTRIBUTING.md)

## License

`json-p3` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

---
_Source: https://npm.io/package/json-p3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
