# @criteria/json-pointer

> Implementation of JSON Pointer (RFC 6901).

Latest version **0.2.1** (published 2024-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @criteria/json-pointer
pnpm add @criteria/json-pointer
yarn add @criteria/json-pointer
bun add @criteria/json-pointer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2024-07-04 |
| First published | 2023-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.12.1 |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Criteria Labs Pty Ltd |
| Maintainers | jamesmoschou-criteria |
| Keywords | json, json-pointer, jsonpointer, pointer, rfc6901, rfc-6901, 6901 |

## Links

- npm: https://www.npmjs.com/package/@criteria/json-pointer
- Repository: https://github.com/criteria-labs/criteria-api-tools
- Issues: https://github.com/criteria-labs/criteria-api-tools/issues
- npm.io page: https://npm.io/package/@criteria/json-pointer

## 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

- 0.2.1 (latest) — 2024-07-04
- 0.2.0 — 2024-07-04
- 0.1.1 — 2024-01-02
- 0.1.0 — 2023-02-12
- 0.0.0 — 2023-01-04

## README

# JSON Pointer

Implementation of JSON Pointer ([RFC 6901](https://www.rfc-editor.org/rfc/rfc6901)).

## Installation

```
npm install @criteria/json-pointer
```

## Usage

Evaluate a JSON Pointer:

```
import { evaluateJSONPointer } from '@criteria/json-pointer'

const str = '#/foo'
const document = {
    foo: true
}

const value = evaluateJSONPointer(str, document)
// value === true
```

Validate that a string is a JSON Pointer:

```
import { validateJSONPointer } from '@criteria/json-pointer'

const str = '#/foo'

try {
  validateJSONPointer(str)
  // valid
} catch (err) {
  // not valid
}
```

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