Scripts2026年4月7日·1 分钟阅读

Zod — TypeScript-First Schema Validation

TypeScript-first schema declaration and validation library. Define a schema once, get type inference, runtime validation, and serialization. The standard for TypeScript data validation. 35,000+ stars.

介绍

Zod is a TypeScript-first data validation library with 35,000+ GitHub stars. Define a schema once and get both type inference and runtime validation.


Quick Start

npm install zod
import { z } from "zod";
const Schema = z.object({ name: z.string(), email: z.string().email() });
type T = z.infer<typeof Schema>;

Overview

Zod is a TypeScript-first data validation library with 35,000+ GitHub stars. Define a schema once and get both type inference and runtime validation.


Source & Thanks

Created by Colin McDonnell. Licensed under MIT.

zod — stars 35,000+

🙏

来源与感谢

Created by Colin McDonnell. Licensed under MIT.

zod — stars 35,000+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产