Synchronous and async JSON Schema $ref dereferencing library for Node.js. Version 0.5.0 resolves local, file, and web references in JSON Schema objects by replacing $ref pointers with their resolved values. Unlike alternatives like json-schema-ref-parser, it offers a simpler API and optional caching of remote refs. Includes TypeScript types. Primarily maintained for legacy Node.js (>=6.0.0) projects; newer work is on json-schema-deref-sync. Release cadence is low; no recent updates.
npm install json-schema-derefNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Resolves a simple local $ref in a JSON Schema using the callback-based API with minimal options.
Upgrade Node.js to >=6.0.0 or use a compatible version of the package.
Switch to json-schema-deref-sync for local schemas, or fork/monkey-patch with a different HTTP library (e.g., node-fetch).
Implement a custom loader with your own timeout/retry logic via the `loader` option, or pre-fetch schemas.
Always provide a callback function as the third argument.
Set options.cache = false or adjust cacheTTL to a smaller value for fresh results.
Set failOnMissing: true to error out on unresolvable refs, or explicitly handle unresolved refs in the result.
Use const deref = require('json-schema-deref'); instead of import statements.Run `npm install request` to install request, or use the library without remote schemas (local $refs only).
Check network connectivity, use a custom loader that handles errors, or pre-fetch the remote schema.