zod
The zod
package is the "flagship" library of the Zod ecosystem. It strikes a balance between developer experience and bundle size that's ideal for the vast majority of applications.
If you have uncommonly strict constraints around bundle size, consider @zod/mini
.
Zod aims to provide a schema API that maps one-to-one to TypeScript's type system.
The API relies on methods to provide a concise, chainable, autocomplete-friendly way to define complex types.
All schemas extend the z.ZodType
base class, which in turn extends z.$ZodType
from @zod/core
. All instance of ZodType
implement the following methods: