Composable Step Pipeline
Chain built-in validation steps or create custom plugins. Each step can validate, transform, or handle failures—all with the same ergonomic API.
Modular TypeScript validation library with composable steps, full type inference, and deterministic issue reporting. Standard Schema V1 compliant.
Define schemas with intuitive, chainable methods. Get full TypeScript inference automatically.
import { v } from 'valchecker'
// Define a user schema with composable steps
const UserSchema = v.object({
name: v.string()
.toTrimmed()
.min(1),
email: v.string(),
age: [v.number()
.integer()
.min(0)], // Optional
role: v.union([v.literal('admin'), v.literal('user'), v.literal('guest')]),
})
// Full type inference - no manual types needed
type User = InferOutput<typeof UserSchema>
// Validate with detailed issue reporting
const result = await UserSchema.execute(input)
if ('value' in result) {
console.log(result.value) // Fully typed User
}
else {
console.log(result.issues) // Structured issues with paths
}Unlike validation libraries that treat runtime and compile-time as separate concerns, Valchecker unifies them. Every schema is both a runtime validator and a TypeScript type generator. Transforms update types automatically. Failures produce predictable, structured issues—not thrown exceptions. The result is validation code that's easier to write, test, and maintain.