FasterSchema is an isomorphic JavaScript object schema validation library (v2.1.0) designed as a faster alternative to SimpleSchema with a similar API. It validates objects, cleans data (type conversion, property removal, automatic values), and provides a customizable error message system with localization support. Compared to SimpleSchema, it is approximately 20x faster for validation and 50x faster for cleaning complex objects, but does not support MongoDB modifier validation. Active development, frequent releases, hundreds of tests.
npm install faster-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates schema definition, validation with error handling, and object cleaning with FasterSchema.
Use import syntax or switch to dynamic import: const FasterSchema = await import('faster-schema')const emailRegex = new RegExp(/^...$/, 'i'); new FasterSchema({ email: { type: String, regEx: emailRegex } })const cleaned = schema.clean(obj, { mutate: false });Replace required: true with optional: false (default). For optional fields, set optional: true.
const schema = new FasterSchema({ ... });npm install faster-schema && npm install @types/faster-schema (if available) or ensure tsconfig includes node_modules.
Define schema fields as objects: { email: { type: String, optional: true } }No dependency data recorded yet.