This module works with any Standard Schema compatible library. Standard Schema is a shared interface that lets validation libraries work interchangeably.
| Library | Bundle Size | Style |
|---|---|---|
| Valibot | ~1KB | Functional, tree-shakeable |
| Zod | ~12KB | Method chaining |
| ArkType | ~25KB | Type-first, inference |
All provide the same validation capabilities. Choose based on your preference.
import { object, string, number, optional } from 'valibot'
const schema = object({
apiKey: string(),
port: optional(number()),
})
import { z } from 'zod'
const schema = z.object({
apiKey: z.string(),
port: z.number().optional(),
})
import { type } from 'arktype'
const schema = type({
apiKey: 'string',
'port?': 'number',
})