{"name":"@apidevtools/json-schema-ref-parser","version":"9.0.7","keywords":["json","schema","jsonschema","json-schema","json-pointer","$ref","dereference","resolve"],"author":{"url":"https://jamesmessinger.com","name":"James Messinger"},"license":"MIT","_id":"@apidevtools/json-schema-ref-parser@9.0.7","maintainers":[{"name":"philsturgeon","email":"me@philsturgeon.uk"},{"name":"james_messinger","email":"j.ames.messinger@gmail.com"},{"name":"jamesmessinger","email":"james.messinger@gmail.com"}],"contributors":[{"name":"Boris Cherny","email":"boris@performancejs.com"}],"homepage":"https://apitools.dev/json-schema-ref-parser/","bugs":{"url":"https://github.com/APIDevTools/json-schema-ref-parser/issues"},"dist":{"shasum":"64aa7f5b34e43d74ea9e408b90ddfba02050dde3","tarball":"http://registry-npm.ywwl.com/@apidevtools/json-schema-ref-parser/download/@apidevtools/json-schema-ref-parser-9.0.7.tgz","fileCount":24,"integrity":"sha512-QdwOGF1+eeyFh+17v2Tz626WX0nucd1iKOm6JUTUvCZdbolblCOOQCxGrQPY0f7jEhn36PiAWqZnsC2r5vmUWg==","signatures":[{"sig":"MEYCIQD4jtqBG/2jYR2pBqOIX24ETzDj1ikVaYibkVIjB0LwdwIhALhiGUemsoSIvBE/CPmd2djxIF/ul8PUby6Q+Lz0fqwF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBWOyCRA9TVsSAnZWagAAC0gP/0RYITJHAn5IlJhiiPYJ\n7kdgeMi7zRD474zp0xpGqGAX97hGMKIF9phGsUkLL7DE/DGLdfxUc+bTMQOo\ns20joPlqUO06H4SfcNNJYz4W06XE+sO4X5W7t8hmoFsvFOcbG4oGRABUeUjW\nkJjLHGuFYzDpLlKub7Xa+EevcdogMLcKpSF2uRD4UaSoE5FEFm/eHBjSMTzu\nKjJfuv+DSjKS6qFcdAgdOmTBpRxwVOG2Gr2hjOfB+JHFbw0e+lPgWP1xUBLK\nSUK1ROPFlDKwC4oUuuaT2aZPClNSUpr/eru2xflRJ+2s8JSowZL67oK2XuyI\nbVW+vnt5jtAw/XNl2AQCt6yglEudipvBPUM8+Jq05HJLZFwSZMyCrSFDpnbD\nGTn9YLSdaYFuEVgSdRswI6eDKAbFq6eoEqieH3z9x2h3mdzQ1RKfOavXr3uG\n7lbwv1ySD6aHZJUJK5nOYx1/nN/KAVMavbPtP7d2Fbxn6bKTuZiB4unhfAEc\nam25IdrHE+1GQoGBByLzuiCftlfEn6rhz2sivOIVSw0h1M9u3+SZkoJXsYTE\nTb+14YQuy08F0pH2jJZ7l/1aM38zfbttKV9bs+7IcftbsAsowVR3gg021Eq6\nUCVXLiGsN/BJQX4RCHbQhMDXQLSQJuyUQJJKh++h1ir2fX2i2TPYhzqfisRi\nheBE\r\n=qEse\r\n-----END PGP SIGNATURE-----\r\n","size":34787,"noattachment":false,"key":"/@apidevtools/json-schema-ref-parser/-/@apidevtools/json-schema-ref-parser-9.0.7.tgz"},"main":"lib/index.js","browser":{"fs":false},"gitHead":"84c06eb9f36bc3df3142fe34adcbbfb35ef697f6","scripts":{"bump":"bump --tag --push --all","lint":"eslint lib test/fixtures test/specs","test":"npm run test:node && npm run test:typescript && npm run test:browser && npm run lint","clean":"shx rm -rf .nyc_output coverage","release":"npm run upgrade && npm run clean && npm test && npm run bump","upgrade":"npm-check -u && npm audit fix","coverage":"npm run coverage:node && npm run coverage:browser","test:node":"mocha","test:browser":"karma start --single-run","coverage:node":"nyc node_modules/mocha/bin/mocha","test:typescript":"tsc --noEmit --strict --lib esnext,dom test/specs/typescript-definition.spec.ts","coverage:browser":"npm run test:browser -- --coverage"},"typings":"lib/index.d.ts","_npmUser":{"name":"jamesmessinger","email":"james.messinger@gmail.com"},"repository":{"url":"git+https://github.com/APIDevTools/json-schema-ref-parser.git","type":"git"},"_npmVersion":"6.14.10","description":"Parse, Resolve, and Dereference JSON Schema $ref pointers","directories":{},"_nodeVersion":"10.23.1","dependencies":{"js-yaml":"^3.13.1","call-me-maybe":"^1.0.1","@jsdevtools/ono":"^7.1.3"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.1","shx":"^0.3.2","chai":"^4.2.0","karma":"^5.0.2","mocha":"^8.2.1","eslint":"^7.18.0","karma-cli":"^2.0.0","npm-check":"^5.9.0","typescript":"^4.0.5","@types/node":"^14.14.21","chai-subset":"^1.6.0","@babel/polyfill":"^7.12.1","@types/json-schema":"^7.0.6","@jsdevtools/karma-config":"^3.1.7","@jsdevtools/eslint-config":"^1.0.7","@jsdevtools/host-environment":"^2.1.2","@jsdevtools/version-bump-prompt":"^6.1.0"},"_npmOperationalInternal":{"tmp":"tmp/json-schema-ref-parser_9.0.7_1610965937502_0.7871133222537585","host":"s3://npm-registry-packages"},"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\nInstallation\n--------------------------\nInstall using [npm](https://docs.npmjs.com/about-npm/):\n\n```bash\nnpm install @apidevtools/json-schema-ref-parser\nyarn add @apidevtools/json-schema-ref-parser\nbun add @apidevtools/json-schema-ref-parser\n```\n\nThe 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      // references an external file\n      \"$ref\": \"schemas/people/Bruce-Wayne.json\"\n    },\n    \"place\": {\n      // references a sub-schema in an external file\n      \"$ref\": \"schemas/places.yaml#/definitions/Gotham-City\"\n    },\n    \"thing\": {\n      // references a URL\n      \"$ref\": \"http://wayne-enterprises.com/things/batmobile\"\n    },\n    \"color\": {\n      // references a value in an external file via an internal reference\n      \"$ref\": \"#/definitions/thing/properties/colors/black-as-the-night\"\n    }\n  }\n}\n```\n\nThe 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://apitools.dev/json-schema-ref-parser/docs/plugins/resolvers.html) such as databases\n- Can [bundle](https://apitools.dev/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://apitools.dev/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://apitools.dev/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\nExample\n--------------------------\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://apitools.dev/json-schema-ref-parser/docs/)\n\n\nPolyfills\n--------------------------\n\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\nBrowser 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\nAPI Documentation\n--------------------------\nFull API documentation is available [right here](https://apitools.dev/json-schema-ref-parser/docs/)\n\n\nContributing\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   `yarn install`\n\n3. __Run the tests__<br>\n   `yarn test`\n\nLicense\n--------------------------\nJSON Schema $Ref Parser is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.\n\nThis package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a\ntree**](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser) to thank us for our work. By contributing to\nthe Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\n\n\n\nBig Thanks To\n--------------------------\nThanks to these awesome companies for their support of Open Source developers ❤\n\n[![Stoplight](https://svgshare.com/i/TK5.svg)](https://stoplight.io/?utm_source=github&utm_medium=readme&utm_campaign=json_schema_ref_parser)\n[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)\n[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)\n","publish_time":1610965937607,"_cnpm_publish_time":1610965937607,"dist-tags":{"latest":"16.0.5","release-v9.1.x":"9.1.2"}}