value-schema is a declarative input validator for Node.js, TypeScript, Deno, and Bun. Version 4.0.0 (stable) provides schema-based validation with automatic type coercion, default values, trimming, and checksum support (e.g., Luhn). It simplifies the common web app pattern of existence check, type check, and domain check into a single, readable schema definition. Unlike JSON Schema or Joi, it offers built-in email, date, IPv4/IPv6, and credit card validators with compact syntax. It ships TypeScript types and supports ESM and CJS.
npm install value-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates schema definition with various validators and applying to input, showing type coercion and default values.
Use `import vs from 'value-schema'` or `const vs = (await import('value-schema')).default;` for CJS.Replace `new Schema(...)` with `vs.object({...})` or `vs.applySchemaObject(...)`.Wrap call in try/catch or pre-validate input existence.
Update to new constant names from migration guide.
Use `vs.string({ trim: true })` for each element or pre-trim the string.Use `const vs = require('value-schema').default;` or switch to ESM `import vs from 'value-schema';`.Run `npm install value-schema` and ensure correct import path.
Use default import: `import vs from 'value-schema'`.
Ensure input is an object (use `{}` as fallback).No dependency data recorded yet.