{"name":"@apidevtools/json-schema-ref-parser","version":"15.5.0","keywords":["json","schema","jsonschema","json-schema","json-pointer","$ref","dereference","resolve"],"author":{"url":"https://jonlu.ca","name":"JonLuca DeCaro","email":"apis@jonlu.ca"},"license":"MIT","_id":"@apidevtools/json-schema-ref-parser@15.5.0","maintainers":[{"name":"jonluca","email":"jonluca.decaro@gmail.com"},{"name":"jamesmessinger","email":"james.messinger@gmail.com"},{"name":"philsturgeon","email":"me@philsturgeon.uk"}],"contributors":[{"name":"Boris Cherny","email":"boris@performancejs.com"},{"name":"Phil Sturgeon","email":"phil@apisyouwonthate.com"},{"name":"Jakub Rożek","email":"jakub@stoplight.io"},{"url":"https://jamesmessinger.com","name":"James Messinger"}],"homepage":"https://apidevtools.com/json-schema-ref-parser/","bugs":{"url":"https://github.com/APIDevTools/json-schema-ref-parser/issues"},"dist":{"shasum":"ba1f1c10a5d423ae55ac926c86543236c4a314dc","tarball":"http://registry-npm.ywwl.com/@apidevtools/json-schema-ref-parser/download/@apidevtools/json-schema-ref-parser-15.5.0.tgz","fileCount":78,"integrity":"sha512-Ps4w0FwrDoeVK6hfYxWkVbkmxm+zN+6xoXF2ZfEhfiox0ZNbcSAiUWO6iAIvP5bc3DB270r+EaKcoT1IUyzfxw==","signatures":[{"sig":"MEQCIHYIpq/ZOyimdyv3rV8MRK9h+R0wcXw4+u2MDi0TiXvxAiBl90qY1cuAbvkWStTITqO7bFiY4E6mmyVX7/q3gpEhDQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apidevtools%2fjson-schema-ref-parser@15.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":380200,"size":83797,"noattachment":false,"key":"/@apidevtools/json-schema-ref-parser/-/@apidevtools/json-schema-ref-parser-15.5.0.tgz"},"main":"dist/lib/index.js","type":"module","types":"dist/lib/index.d.ts","module":"dist/lib/index.js","browser":{"fs":false},"engines":{"node":">=20"},"gitHead":"a8e6b4d6517dac6f96b9953872223a14eb3baeac","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/npm","@semantic-release/github"],"branches":["main"]},"scripts":{"lint":"eslint lib","test":"vitest --coverage","build":"rimraf dist && tsc","prettier":"prettier --write \"**/*.+(js|jsx|ts|tsx|har||json|css|md)\"","test:node":"pnpm test","typecheck":"tsc --noEmit","test:watch":"vitest -w","test:update":"vitest -u","test:browser":"node ./test/fixtures/run-browser-tests.mjs","test:specific":"vitest invalid","prepublishOnly":"pnpm build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7b20e5f9-4c31-4bc5-aa59-4fe1d923908d"}},"repository":{"url":"git+https://github.com/APIDevTools/json-schema-ref-parser.git","type":"git"},"_npmVersion":"11.16.0","description":"Parse, Resolve, and Dereference JSON Schema $ref pointers","directories":{},"_nodeVersion":"24.18.0","dependencies":{"js-yaml":"^4.2.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.5.3","devDependencies":{"jsdom":"^29.1.1","eslint":"^10.4.1","rimraf":"^6.1.3","vitest":"^4.1.8","globals":"^17.6.0","prettier":"^3.8.4","cross-env":"^10.1.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.9.3","@types/eslint":"^9.6.1","@eslint/compat":"^2.1.0","@types/js-yaml":"^4.0.9","typescript-eslint":"^8.61.0","@types/json-schema":"^7.0.15","@vitest/coverage-v8":"^4.1.8","eslint-plugin-import":"^2.32.0","eslint-plugin-promise":"^7.3.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6","@typescript-eslint/parser":"^8.61.0","eslint-plugin-unused-imports":"^4.4.1","@typescript-eslint/eslint-plugin":"^8.61.0"},"peerDependencies":{"@types/json-schema":"^7.0.15"},"_npmOperationalInternal":{"tmp":"tmp/json-schema-ref-parser_15.5.0_1783576087508_0.553074772494079","host":"s3://npm-registry-packages-npm-production"},"readme":"# JSON Schema $Ref Parser\n\n#### Parse, Resolve, and Dereference JSON Schema $ref pointers\n\n[![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/actions)\n[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/json-schema-ref-parser/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/json-schema-ref-parser)\n\n[![npm](https://img.shields.io/npm/v/@apidevtools/json-schema-ref-parser.svg)](https://www.npmjs.com/package/@apidevtools/json-schema-ref-parser)\n[![License](https://img.shields.io/npm/l/@apidevtools/json-schema-ref-parser.svg)](LICENSE)\n[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser)\n\n## Installation\n\nInstall using [npm](https://docs.npmjs.com/about-npm/):\n\n```bash\nnpm install @apidevtools/json-schema-ref-parser\npnpm add @apidevtools/json-schema-ref-parser\nbun add @apidevtools/json-schema-ref-parser\n```\n\n## The Problem:\n\nYou've got a JSON Schema with `$ref` pointers to other files and/or URLs. Maybe you know all the referenced files ahead\nof time. Maybe you don't. Maybe some are local files, and others are remote URLs. Maybe they are a mix of JSON and YAML\nformat. Maybe some of the files contain cross-references to each other.\n\n```json\n{\n  \"definitions\": {\n    \"person\": {\n      \"$ref\": \"schemas/people/Bruce-Wayne.json\"\n    },\n    \"place\": {\n      \"$ref\": \"schemas/places.yaml#/definitions/Gotham-City\"\n    },\n    \"thing\": {\n      \"$ref\": \"http://wayne-enterprises.com/things/batmobile\"\n    },\n    \"color\": {\n      \"$ref\": \"#/definitions/thing/properties/colors/black-as-the-night\"\n    }\n  }\n}\n```\n\n## The Solution:\n\nJSON Schema $Ref Parser is a full [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03)\nand [JSON Pointer](https://tools.ietf.org/html/rfc6901) implementation that crawls even the most\ncomplex [JSON Schemas](http://json-schema.org/latest/json-schema-core.html) and gives you simple, straightforward\nJavaScript objects.\n\n- Use **JSON** or **YAML** schemas &mdash; or even a mix of both!\n- Supports `$ref` pointers to external files and URLs, as well\n  as [custom sources](https://apidevtools.com/json-schema-ref-parser/docs/plugins/resolvers.html) such as databases\n- Can [bundle](https://apidevtools.com/json-schema-ref-parser/docs/ref-parser.html#bundlepath-options-callback) multiple\n  files into a single schema that only has _internal_ `$ref` pointers\n- Can [dereference](https://apidevtools.com/json-schema-ref-parser/docs/ref-parser.html#dereferencepath-options-callback)\n  your schema, producing a plain-old JavaScript object that's easy to work with\n- Supports [circular references](https://apidevtools.com/json-schema-ref-parser/docs/#circular-refs), nested references,\n  back-references, and cross-references between files\n- Maintains object reference equality &mdash; `$ref` pointers to the same value always resolve to the same object\n  instance\n- Compatible with Node LTS and beyond, and all major web browsers on Windows, Mac, and Linux\n\n## Example\n\n```javascript\nimport $RefParser from \"@apidevtools/json-schema-ref-parser\";\n\ntry {\n  await $RefParser.dereference(mySchema);\n  // note - by default, mySchema is modified in place, and the returned value is a reference to the same object\n  console.log(mySchema.definitions.person.properties.firstName);\n\n  // if you want to avoid modifying the original schema, you can disable the `mutateInputSchema` option\n  let clonedSchema = await $RefParser.dereference(mySchema, { mutateInputSchema: false });\n  console.log(clonedSchema.definitions.person.properties.firstName);\n} catch (err) {\n  console.error(err);\n}\n```\n\nFor more detailed examples, please see the [API Documentation](https://apidevtools.com/json-schema-ref-parser/docs/)\n\n## Polyfills\n\nIf you are using Node.js < 18, you'll need a polyfill for `fetch`,\nlike [node-fetch](https://github.com/node-fetch/node-fetch):\n\n```javascript\nimport fetch from \"node-fetch\";\n\nglobalThis.fetch = fetch;\n```\n\n## Browser support\n\nJSON Schema $Ref Parser supports recent versions of every major web browser. Older browsers may\nrequire [Babel](https://babeljs.io/) and/or [polyfills](https://babeljs.io/docs/en/next/babel-polyfill).\n\nTo use JSON Schema $Ref Parser in a browser, you'll need to use a bundling tool such\nas [Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/), [Parcel](https://parceljs.org/),\nor [Browserify](http://browserify.org/). Some bundlers may require a bit of configuration, such as\nsetting `browser: true` in [rollup-plugin-resolve](https://github.com/rollup/rollup-plugin-node-resolve).\n\n#### Webpack 5\n\nWebpack 5 has dropped the default export of node core modules in favour of polyfills, you'll need to set them up\nyourself ( after npm-installing them )\nEdit your `webpack.config.js` :\n\n```js\nconfig.resolve.fallback = {\n  path: require.resolve(\"path-browserify\"),\n  fs: require.resolve(\"browserify-fs\"),\n};\n\nconfig.plugins.push(\n  new webpack.ProvidePlugin({\n    Buffer: [\"buffer\", \"Buffer\"],\n  }),\n);\n```\n\n## API Documentation\n\nFull API documentation is available [right here](https://apidevtools.com/json-schema-ref-parser/docs/)\n\n## Contributing\n\nI welcome any contributions, enhancements, and\nbug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub\nand [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls).\n\n#### Building/Testing\n\nTo build/test the project locally on your computer:\n\n1. **Clone this repo**<br>\n   `git clone https://github.com/APIDevTools/json-schema-ref-parser.git`\n\n2. **Install dependencies**<br>\n   `pnpm install`\n\n3. **Run the tests**<br>\n   `pnpm test`\n\n## License\n\nJSON Schema $Ref Parser is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.\n\n## Thanks\n\nThanks to these awesome contributors for their major support of this open-source project.\n\n- [JonLuca De Caro](https://jonlu.ca)\n- [Phil Sturgeon](https://philsturgeon.com)\n- [Stoplight](https://stoplight.io/?utm_source=github&utm_medium=readme&utm_campaign=json_schema_ref_parser)\n","publish_time":1783576087670,"_cnpm_publish_time":1783576087670,"dist-tags":{"latest":"16.0.5","release-v9.1.x":"9.1.2"}}