生态系统
注意 — 为了避免臃肿和混淆,生态系统部分在 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 | ⭐️ 39201 | Build end-to-end typesafe APIs without GraphQL. |
oRPC | ⭐️ 4533 | Typesafe APIs Made Simple |
upfetch | ⭐️ 1359 | Advanced fetch client builder |
nestjs-zod | ⭐️ 931 | Integrate nestjs and zod. Create nestjs DTOs using zod, serialize with zod, and generate OpenAPI documentation from zod schemas |
Express Zod API | ⭐️ 790 | Build Express-based API with I/O validation and middlewares, OpenAPI docs and type-safe client. |
Zod Sockets | ⭐️ 110 | Socket.IO solution with I/O validation, an AsyncAPI generator, and a type-safe events map. |
GQLoom | ⭐️ 80 | Weave GraphQL schema and resolvers using Zod. |
Zod JSON-RPC | ⭐️ 15 | Type-safe JSON-RPC 2.0 client/server library using Zod. |
表单集成
| Name | Stars | Description |
|---|---|---|
Superforms | ⭐️ 2699 | Making SvelteKit forms a pleasure to use! |
conform | ⭐️ 2507 | 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 | ⭐️ 997 | Generate user-friendly error messages from ZodError instances. |
regle | ⭐️ 349 | Headless form validation library for Vue.js. |
svelte-jsonschema-form | ⭐️ 138 | Svelte 5 library for creating forms based on JSON schema. |
frrm | ⭐️ 30 | 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 | ⭐️ 783 | Generate Zod schemas from Prisma schema with full ZodObject method support |
zod-openapi | ⭐️ 591 | Use Zod Schemas to create OpenAPI v3.x documentation |
convex-helpers | ⭐️ 370 | Use Zod to validate arguments and return values of Convex functions, and to create Convex database schemas |
zod2md | ⭐️ 132 | Generate Markdown docs from Zod schemas |
@traversable/zod | ⭐️ 132 | Build your own "Zod to x" library, or pick one of 25+ off-the-shelf transformers |
fastify-zod-openapi | ⭐️ 115 | Fastify type provider, validation, serialization and @fastify/swagger support for Zod schemas |
zod-to-mongo-schema | ⭐️ 5 | Convert Zod schemas to MongoDB-compatible JSON Schemas effortlessly |
X 到 Zod
| Name | Stars | Description |
|---|---|---|
orval | ⭐️ 5074 | Generate Zod schemas from OpenAPI schemas |
Hey API | ⭐️ 3731 | The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. |
kubb | ⭐️ 1505 | The ultimate toolkit for working with APIs. |
Prisma Zod Generator | ⭐️ 783 | 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 | ⭐️ 370 | Generate Zod schemas from Convex validators |
DRZL | ⭐️ 88 | Drizzle ORM toolkit that can generate Zod validators from schema(s), plus typed services and strongly typed routers (oRPC/tRPC/etc). |
valype | ⭐️ 63 | Typescript's type definition to runtime validator (including zod). |
模拟库
| Name | Stars | Description |
|---|---|---|
@traversable/zod-test | ⭐️ 132 | Random zod schema generator built for fuzz testing; includes generators for both valid and invalid data |
zod-schema-faker | ⭐️ 95 | Generate mock data from zod schemas. Powered by @faker-js/faker and randexp.js. |
zocker | ⭐️ 74 | Generates valid, semantically meaningful data for your Zod schemas. |
使用 Zod 的项目
| Name | Stars | Description |
|---|---|---|
Composable Functions | ⭐️ 738 | Types and functions to make composition easy and safe. |
zod-config | ⭐️ 129 | Load configurations across multiple sources with flexible adapters, ensuring type safety with Zod. |
zod-xlsx | ⭐️ 49 | A xlsx based resource validator using Zod schemas for data imports and more |
Fn Sphere | ⭐️ 26 | A Zod-first toolkit for building powerful, type-safe filter experiences across web apps. |
zodgres | ⭐️ 19 | 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 | ⭐️ 118 | Interactive playground for testing and exploring Zod and Zod mini schemas in real-time. |
zod-ir | ⭐️ 52 | 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 | ⭐️ 47 | ESLint plugin that adds custom linting rules to enforce best practices when using Zod |
eslint-plugin-import-zod | ⭐️ 46 | ESLint plugin to enforce namespace imports for Zod. |
Zod Compare | ⭐️ 9 | A utility library for recursively comparing Zod schemas. |

