A synchronous Node.js library to dereference $ref pointers in JSON Schema documents, resolving local and file-based references to their actual values. Current stable version is 0.14.0, with low release cadence (last update in 2019). It is a lighter alternative to json-schema-deref, omitting web references and working synchronously. Useful for expanding JSON Schemas at build time or in synchronous contexts. Supports options like baseFolder, failOnMissing, mergeAdditionalProperties, removeIds, and custom loaders.
npm install json-schema-deref-syncNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates synchronous dereferencing of local $ref and file $ref with options.
Use json-schema-deref (async) if web dereferencing is needed.
Remove callback and handle returned value or Error with try/catch.
Set mergeAdditionalProperties: true if you want to keep sibling properties, and review lodash.merge documentation.
Be aware of this behavior; manually clean up IDs after dereferencing if needed.
Set failOnMissing: true to throw an error on unresolvable refs.
Use `const deref = require('json-schema-deref-sync');` or `import * as deref from 'json-schema-deref-sync';`Use json-schema-deref (async) or download the schema locally first.
Use the result directly: `const result = deref(schema, options);`
Ensure the referenced file exists or set failOnMissing: false to keep the unresolved ref.