Historical library implementing early JSON Schema draft specifications (draft-01 to draft-04). Current version 0.4.0 is considered finished and stable, with no active development. It provides a simple, efficient validator for the original core elements but does not support later drafts (draft-06, draft-07, 2019-09, 2020-12). Used by many legacy npm packages due to its stability and small size. Not suitable for new projects requiring current JSON Schema compliance. Alternatives: ajv (full drafts), @cfworker/json-schema (modern).
npm install json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows JSON Schema validation of an object instance against a schema, checking for errors using the validate function.
Use ajv or @cfworker/json-schema for modern drafts.
Migrate to a maintained library (e.g., ajv).
Clone schema before passing if needed: validate(instance, JSON.parse(JSON.stringify(schema))).
Access result.errors[0].property, .message, .schema; not .instancePath, .keyword.
Ensure schema is a valid object with type property: const schema = { type: 'object' };Remove $schema from schema or ensure schema is plain object without unrecognized keys.
No dependency data recorded yet.