Skip to content

valcheckerRuntime-first validation with zero guesswork

Modular TypeScript validation library with composable steps, full type inference, and deterministic issue reporting. Standard Schema V1 compliant.

See It In Action

Define schemas with intuitive, chainable methods. Get full TypeScript inference automatically.

typescript
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
}

Why Valchecker?

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.