Zero-dependency JavaScript schema validator that compiles native JS values into fast validator functions. Current stable version is 3.2.44. Released regularly (multiple versions per month). Key differentiators: faster than AJV and dramatically faster than Zod for all-errors validation, JavaScript-native schemas (constructors, literals, arrays, objects), compiled validators with first-error and all-errors modes, full TypeScript support with type inference, zero dependencies, and support for Standard Schema v1 for interoperability with tRPC and TanStack Form.
npm install ascertainNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates compiled validation with discriminated unions, optional fields, and union literals.
Check validateUser.issues for errors instead of catching thrown exceptions.
Use compile() for reusable validators; ascertain() for one-off throws.
Ensure all discriminated variants include the discriminator field as a string literal.
Run 'npm install ascertain' and use import syntax; ensure Node.js version >=12 or use bundler.
Change to 'import { compile } from 'ascertain'.Update to ascertain@3 and access validateUser.issues for error details.
No dependency data recorded yet.