生态系统
注意 — 为了避免臃肿和混淆,生态系统部分在 Zod 4 发布时已被清除。如果您已更新您的库以与 Zod 4 一起使用,请提交 PR 以将其添加回来。对于与 Zod 3 一起使用的库,请参考 v3.zod.dev。
基于 Zod 构建或原生支持 Zod 的工具正在不断增加!如果你基于 Zod 开发了工具或库,请通过 Twitter 告诉我,或在 讨论区 发起讨论。我会将其添加到下面,并在推特上分享。
资源
- Total TypeScript Zod 教程 由 @mattpocockuk 提供
- 修复 TypeScript 的盲点:运行时类型检查 由 @jherr 提供
- 使用 Zod 验证环境变量 由 @catalinmpit 提供
API 库
| Name | Stars | Description |
|---|---|---|
tRPC | ⭐️ 39514 | Build end-to-end typesafe APIs without GraphQL. |
upfetch | ⭐️ 1379 | Advanced fetch client builder |
nestjs-zod | ⭐️ 984 | Integrate nestjs and zod. Create nestjs DTOs using zod, serialize with zod, and generate OpenAPI documentation from zod schemas |
Express Zod API | ⭐️ 796 | Build Express-based API with I/O validation and middlewares, OpenAPI docs and type-safe client. |
Zod Sockets | ⭐️ 116 | Socket.IO solution with I/O validation, an AsyncAPI generator, and a type-safe events map. |
GQLoom | ⭐️ 85 | Weave GraphQL schema and resolvers using Zod. |
Zod JSON-RPC | ⭐️ 20 | Type-safe JSON-RPC 2.0 client/server library using Zod. |
oRPC | ⭐️ 1 | Typesafe APIs Made Simple |
表单集成
| Name | Stars | Description |
|---|---|---|
Superforms | ⭐️ 2722 | Making SvelteKit forms a pleasure to use! |
conform | ⭐️ 2526 | A type-safe form validation library utilizing web fundamentals to progressively enhance HTML Forms with full support for server frameworks like Remix and Next.js. |
zod-validation-error | ⭐️ 1009 | Generate user-friendly error messages from ZodError instances. |
regle | ⭐️ 402 | Headless form validation library for Vue.js. |
svelte-jsonschema-form | ⭐️ 151 | Svelte 5 library for creating forms based on JSON schema. |
frrm | ⭐️ 31 | Tiny 0.5kb Zod-based, HTML form abstraction that goes brr. |
react-f3 | ⭐️ 10 | Components, hooks & utilities for creating and managing delightfully simple form experiences in React. |
Zod 到 X
| Name | Stars | Description |
|---|---|---|
prisma-zod-generator | ⭐️ 805 | Generate Zod schemas from Prisma schema with full ZodObject method support |
zod-openapi | ⭐️ 599 | Use Zod Schemas to create OpenAPI v3.x documentation |
convex-helpers | ⭐️ 416 | Use Zod to validate arguments and return values of Convex functions, and to create Convex database schemas |
@traversable/zod | ⭐️ 142 | Build your own "Zod to x" library, or pick one of 25+ off-the-shelf transformers |
zod2md | ⭐️ 139 | Generate Markdown docs from Zod schemas |
fastify-zod-openapi | ⭐️ 117 | Fastify type provider, validation, serialization and @fastify/swagger support for Zod schemas |
zod-to-mongo-schema | ⭐️ 7 | Convert Zod schemas to MongoDB-compatible JSON Schemas effortlessly |
X 到 Zod
| Name | Stars | Description |
|---|---|---|
orval | ⭐️ 5361 | Generate Zod schemas from OpenAPI schemas |
Hey API | ⭐️ 4055 | The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. |
kubb | ⭐️ 1591 | The ultimate toolkit for working with APIs. |
Prisma Zod Generator | ⭐️ 805 | Generates Zod schemas with input/result/pure variants, minimal/full/custom, selective emit/filtering, single/multi-file output, @zod rules, relation depth guards. |
convex-helpers | ⭐️ 416 | Generate Zod schemas from Convex validators |
DRZL | ⭐️ 94 | Drizzle ORM toolkit that can generate Zod validators from schema(s), plus typed services and strongly typed routers (oRPC/tRPC/etc). |
valype | ⭐️ 66 | Typescript's type definition to runtime validator (including zod). |
Hono Takibi | ⭐️ 47 | Hono Takibi is a code generator from OpenAPI to @hono/zod-openapi |
模拟库
| Name | Stars | Description |
|---|---|---|
@traversable/zod-test | ⭐️ 142 | Random zod schema generator built for fuzz testing; includes generators for both valid and invalid data |
zod-schema-faker | ⭐️ 103 | Generate mock data from zod schemas. Powered by @faker-js/faker and randexp.js. |
zocker | ⭐️ 81 | Generates valid, semantically meaningful data for your Zod schemas. |
使用 Zod 的项目
| Name | Stars | Description |
|---|---|---|
Composable Functions | ⭐️ 739 | Types and functions to make composition easy and safe. |
zod-config | ⭐️ 130 | Load configurations across multiple sources with flexible adapters, ensuring type safety with Zod. |
zod-xlsx | ⭐️ 51 | A xlsx based resource validator using Zod schemas for data imports and more |
Fn Sphere | ⭐️ 30 | A Zod-first toolkit for building powerful, type-safe filter experiences across web apps. |
zodgres | ⭐️ 20 | Postgres.js + Zod: Database collections with static type inference and automatic migrations |
bupkis | ⭐️ 4 | Uncommonly extensible assertions for the beautiful people |
Zod 工具集
| Name | Stars | Description |
|---|---|---|
zod-playground | ⭐️ 124 | Interactive playground for testing and exploring Zod and Zod mini schemas in real-time. |
zod-ir | ⭐️ 59 | Comprehensive validation for Iranian data structures (National Code, Bank Cards, Sheba, Crypto, etc) with smart metadata extraction (Bank Names, Logos). Zero dependencies. |
eslint-plugin-zod-x | ⭐️ 55 | ESLint plugin that adds custom linting rules to enforce best practices when using Zod |
eslint-plugin-import-zod | ⭐️ 49 | ESLint plugin to enforce namespace imports for Zod. |
Zod Compare | ⭐️ 9 | A utility library for recursively comparing Zod schemas. |
babel-plugin-zod-hoist | ⭐️ 4 | Babel plugin that optimizes Zod performance by hoisting schema definitions to the top of the file, avoiding repeated initialization overhead. |

