Licence
MIT
Version
0.2.23
Deps
0
Size
98 kB
Vulns
0
Weekly
0
Veta — @coderbuzz/veta
Runtime-agnostic schema validation for TypeScript. Faster than Zod. Smaller than Yup. Built-in coercion, sync/async pipelines, context forwarding, and schema metadata — zero dependencies.
Why Veta?
- Object shorthand —
{ tags: [string()] }not{ tags: z.array(z.string()) } - Built-in coercion —
coerce(number())handles"42"→42from form data, query params, env vars - Async mirror API —
objectAsync,arrayAsync, etc. with concurrent execution - Context forwarding — pass request-scoped data through every validator level
- Schema metadata —
METADATAsymbol for binary codecs (@coderbuzz/proto) - Zero deps — <5 KB gzip vs Zod's ~35 KB
Installation
npm install @coderbuzz/veta
Quick Start
import { object, string, number, coerce, optional } from "@coderbuzz/veta";
const User = object({
id: coerce(number({ min: 1 })),
name: string({ min: 3 }),
email: string({ pattern: /@/ }),
role: optional(string()),
});
const user = User({ id: "42", name: "Alice", email: "alice@example.com" });
// => { id: 42, name: "Alice", email: "alice@example.com" }
Documentation
Full API reference, migration guide, and comparison with Zod: DOCS.md
License
MIT 2026 Indra Gunawan