Gathering detailed insights and metrics for json-schema-ref-parser
Gathering detailed insights and metrics for json-schema-ref-parser
Gathering detailed insights and metrics for json-schema-ref-parser
Gathering detailed insights and metrics for json-schema-ref-parser
@apidevtools/json-schema-ref-parser
Parse, Resolve, and Dereference JSON Schema $ref pointers
@bcherny/json-schema-ref-parser
Parse, Resolve, and Dereference JSON Schema $ref pointers
@readme/json-schema-ref-parser
Parse, Resolve, and Dereference JSON Schema $ref pointers
@stoplight/json-ref-resolver
Recursively resolve JSON pointers and remote authorities.
Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
npm install json-schema-ref-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
93.9
Quality
80.7
Maintenance
100
Vulnerability
99.6
License
TypeScript (99.64%)
JavaScript (0.32%)
HTML (0.03%)
CSS (0.01%)
Total Downloads
360,571,683
Last Day
59,863
Last Week
1,114,726
Last Month
4,866,447
Last Year
58,529,270
MIT License
1,035 Stars
745 Commits
236 Forks
8 Watchers
14 Branches
51 Contributors
Updated on Jul 07, 2025
Minified
Minified + Gzipped
Latest Version
9.0.9
Package Id
json-schema-ref-parser@9.0.9
Size
6.73 kB
NPM Version
6.14.11
Node Version
12.22.1
Published on
Jun 07, 2021
Cumulative downloads
Total Downloads
Last Day
12.5%
59,863
Compared to previous day
Last Week
-2.5%
1,114,726
Compared to previous week
Last Month
-3.9%
4,866,447
Compared to previous month
Last Year
-4.8%
58,529,270
Compared to previous year
1
You've got a JSON Schema with $ref
pointers to other files and/or URLs. Maybe you know all the referenced files ahead of time. Maybe you don't. Maybe some are local files, and others are remote URLs. Maybe they are a mix of JSON and YAML format. Maybe some of the files contain cross-references to each other.
1{ 2 "definitions": { 3 "person": { 4 // references an external file 5 "$ref": "schemas/people/Bruce-Wayne.json" 6 }, 7 "place": { 8 // references a sub-schema in an external file 9 "$ref": "schemas/places.yaml#/definitions/Gotham-City" 10 }, 11 "thing": { 12 // references a URL 13 "$ref": "http://wayne-enterprises.com/things/batmobile" 14 }, 15 "color": { 16 // references a value in an external file via an internal reference 17 "$ref": "#/definitions/thing/properties/colors/black-as-the-night" 18 } 19 } 20}
JSON Schema $Ref Parser is a full JSON Reference and JSON Pointer implementation that crawls even the most complex JSON Schemas and gives you simple, straightforward JavaScript objects.
$ref
pointers to external files and URLs, as well as custom sources such as databases$ref
pointers$ref
pointers to the same value always resolve to the same object instance1$RefParser.dereference(mySchema, (err, schema) => { 2 if (err) { 3 console.error(err); 4 } 5 else { 6 // `schema` is just a normal JavaScript object that contains your entire JSON Schema, 7 // including referenced files, combined into a single object 8 console.log(schema.definitions.person.properties.firstName); 9 } 10})
Or use async
/await
syntax instead. The following example is the same as above:
1try { 2 let schema = await $RefParser.dereference(mySchema); 3 console.log(schema.definitions.person.properties.firstName); 4} 5catch(err) { 6 console.error(err); 7}
For more detailed examples, please see the API Documentation
Install using npm:
1npm install @apidevtools/json-schema-ref-parser
When using JSON Schema $Ref Parser in Node.js apps, you'll probably want to use CommonJS syntax:
1const $RefParser = require("@apidevtools/json-schema-ref-parser");
When using a transpiler such as Babel or TypeScript, or a bundler such as Webpack or Rollup, you can use ECMAScript modules syntax instead:
1import $RefParser from "@apidevtools/json-schema-ref-parser";
JSON Schema $Ref Parser supports recent versions of every major web browser. Older browsers may require Babel and/or polyfills.
To use JSON Schema $Ref Parser in a browser, you'll need to use a bundling tool such as Webpack, Rollup, Parcel, or Browserify. Some bundlers may require a bit of configuration, such as setting browser: true
in rollup-plugin-resolve.
Full API documentation is available right here
I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.
To build/test the project locally on your computer:
Clone this repo
git clone https://github.com/APIDevTools/json-schema-ref-parser.git
Install dependencies
npm install
Run the tests
npm test
JSON Schema $Ref Parser is 100% free and open-source, under the MIT license. Use it however you want.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
Thanks to these awesome companies for their support of Open Source developers ❤
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
27 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 6/30 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More