# dereference-json-schema

> Dereference $ref pointers in JSONSchema or OpenAPI documents.

Latest version **0.2.3** (published 2026-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install dereference-json-schema
pnpm add dereference-json-schema
yarn add dereference-json-schema
bun add dereference-json-schema
```

## Health

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

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

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

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2026-07-25 |
| First published | 2023-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Viljami Kuosmanen |
| Maintainers | anttiviljami |
| Keywords | dereference, json-schema, openapi, swagger |

## Links

- npm: https://www.npmjs.com/package/dereference-json-schema
- Repository: https://github.com/anttiviljami/dereference-json-schema
- Homepage: https://github.com/anttiviljami/dereference-json-schema#readme
- Issues: https://github.com/anttiviljami/dereference-json-schema/issues
- npm.io page: https://npm.io/package/dereference-json-schema

## 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.3 (latest) — 2026-07-25
- 0.2.2 — 2026-03-10
- 0.2.1 — 2023-02-12
- 0.2.0 — 2023-02-12
- 0.1.1 — 2023-02-11
- 0.0.1 — 2023-02-11

## README

# dereference-json-schema

[![CI](https://github.com/anttiviljami/dereference-json-schema/workflows/CI/badge.svg)](https://github.com/anttiviljami/dereference-json-schema/actions?query=workflow%3ACI)
[![npm version](https://img.shields.io/npm/v/dereference-json-schema.svg)](https://www.npmjs.com/package/dereference-json-schema)
[![npm downloads](https://img.shields.io/npm/dw/dereference-json-schema)](https://www.npmjs.com/package/dereference-json-schema)
[![bundle size](https://img.shields.io/bundlephobia/minzip/dereference-json-schema?label=gzip%20bundle)](https://bundlephobia.com/package/dereference-json-schema)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/anttiviljami/dereference-json-schema/blob/master/LICENSE)
[![Buy me a coffee](https://img.shields.io/badge/donate-buy%20me%20a%20coffee-orange)](https://buymeacoff.ee/anttiviljami)

Dereference $ref pointers in JSONSchema or OpenAPI documents.

Zero dependencies. Synchronous core. Handles circular refs.

## Usage

```
npm i dereference-json-schema
```

```js
import { dereferenceSync } from 'dereference-json-schema';

const schemaWithRefs = {
  schemas: {
    Person: {
      type: 'object',
      properties: {
        name: {
          $ref: '#/schemas/Name',
        },
      },
    },
    Name: {
      type: 'string',
    },
  },
};

const schemaWithNoRefs = dereferenceSync(schemaWithRefs);
```

## Contributing

dereference-json-schema is Free and Open Source Software. Issues and pull requests are more than welcome!

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