Compare JSON schemas intelligently, ignoring order and normalization differences. Version 0.2.2 is the latest stable release. The library handles sorting of arrays (like required, enum, type, dependencies), treats undefined/true/{} as equivalent, and allows ignoring specific keywords via options. It is designed for JSON schema comparison in Node.js, with CommonJS support only.
npm install json-schema-compareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates comparing two JSON schemas with different key ordering, returning true because the package normalizes arrays.
If you need strict equality, don't use this library; rely on deep equality libraries.
If distinction is needed, set the value to -1 or use a custom comparator.
Set uniqueItems explicitly to true or false if you need to distinguish.
Consider using @hyperjump/json-schema or ajv for newer draft support; for simple comparison, keep using this library.
Run npm install json-schema-compare --save and ensure the require is 'json-schema-compare' (not mispelled).
Use const compare = require('json-schema-compare'); (CommonJS).Pass options as an object, e.g., compare(schema1, schema2, { ignore: ['title'] }).No dependency data recorded yet.