What problem does it solve?
Validates data and derives TypeScript types using Zod to ensure boundary safety, reduce runtime errors, and improve developer DX across TypeScript apps.
Core Features & Use Cases
- Schema Definition: enforce correct primitive usage, avoid z.any, and constrain strings, numbers, and dates.
- Parsing & Validation: emphasizes safeParse, async refinements, and collecting all issues for UX improvement.
- Type Inference: leverage z.infer, z.input, and z.output to keep types aligned with schemas, including transforms.
- Error Handling: support custom messages, i18n mappings, and structured error locations for forms.
- Composition & Reuse: extend, pick, omit, and discriminated unions for scalable schemas.
- Performance & Bundle: strategies like caching, lazy loading, and optional Zod Mini for lean frontends.
Quick Start
Create a Zod schema for an input object and run safeParse to obtain a typed result.