# dereference-json-schema
[](https://github.com/anttiviljami/dereference-json-schema/actions?query=workflow%3ACI)
[](https://www.npmjs.com/package/dereference-json-schema)
[](https://www.npmjs.com/package/dereference-json-schema)
[](https://bundlephobia.com/package/dereference-json-schema)
[](https://github.com/anttiviljami/dereference-json-schema/blob/master/LICENSE)
[](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!