Dynamic JSON-Schema validator supporting draft-04 and draft-06. Version 2.1.4 is current stable; v2.0.0 made draft-06 the default. It provides lightweight, fast validation with an environment-based API, custom formats, error handlers, and schema import/export. Differentiates from ajv by being smaller and simpler, but less feature-rich and slower.
npm install djvNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a djv environment, adds a schema, and validates objects against it.
Explicitly set version: new djv({ version: 'draft-04' }) or use @korzio/djv-draft-04 package.Use const djv = require('djv').default or upgrade to v2.Check if return value is undefined: if (env.validate(name, obj) === undefined) { /* valid */ }Use addFormat for custom formats, and be aware that standard formats like 'email' are not validated by default.
Always use addSchema() before validate() with a path like 'schemaName#/definitions/sub'.
Use import djv from 'djv' or const djv = require('djv').default.Use const env = new djv();
Ensure you call new djv() and store result in a variable.