Barebones JSON schema validation library for JavaScript, Node, and Express. Version 3.3.1 provides built-in checks for required fields, default values, type matching (via Object.prototype.toString), length constraints (min/max), and regex tests. Supports nested object schemas and Express middleware integration. Compared to libraries like Joi or Ajv, this is minimal and no longer actively developed.
npm install schema-validatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a schema with username and age fields, validates input, and logs result.
Consider migrating to a maintained alternative like Ajv or Joi.
Use String, Number, Boolean, etc. as type values.
Explicitly set required: false if you don't want defaults to be applied.
Test nested schemas thoroughly; consider flattening the schema.
Use const Validator = require('schema-validator'); and new Validator(schema);Create an instance: const validator = new Validator(schema); then validator.check(data);
Use String, Number, Boolean, etc. as type values.
No dependency data recorded yet.