OSS Tanbou

Zod — derive TypeScript types and runtime validation from one schema

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
43,982
Primary language
TypeScript
License
MIT
Repository last updated
Sep 19, 2026

Overview

Zod is a TypeScript-first validation library that defines schemas for runtime data while inferring static types from the same declarations. It is useful at boundaries such as API responses, form data, configuration, and other external input.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Parse runtime data into validated typed values

Schemas such as z.object describe expected structure, and .parse validates input before returning a strongly typed result.

Sources: [2][3]

Use async validation, transforms, and JSON Schema conversion

Async refinements use parseAsync, and schemas can also participate in transforms and JSON Schema workflows.

Sources: [2][3]

For explicit runtime boundaries around TypeScript applications

It fits API, form, environment, and configuration boundaries where untrusted values need runtime checks in addition to compile-time types.

Sources: [2]

Consider runtime cost and compilation restrictions

Large or hot-path validation should be benchmarked. The optional AOT compile path uses new Function, which may not be allowed under restrictive Content Security Policies.

Sources: [2]

Official sources

  1. [1]colinhacks/zod repository(2026-09-21)
  2. [2]Zod README(2026-09-21)
  3. [3]Zod documentation(2026-09-21)
  4. [4]zod package(2026-09-21)
  5. [5]Zod MIT license(2026-09-21)
Supplemental curator note

Zod validates runtime data that TypeScript types alone cannot protect, such as API inputs and environment variables. The current `zod` package is 4.6.5. The README also documents AOT compilation, which uses `new Function`; environments with restrictive CSP policies should verify whether that optimization is permitted.

Try it in 3 steps

  1. 1

    Install Zod

    Add Zod using the installation command from the official README.

    npm install zod
  2. 2

    Define an object schema

    Describe the expected runtime data shape in TypeScript.

    const Player = z.object({ username: z.string(), xp: z.number() })
  3. 3

    Validate input with parse

    Parse an input and inspect the validated, typed result.

    Player.parse({ username: "billie", xp: 100 })
Check the official README

Growth

Growth trends · Last 30 days

43,982 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
166
Open PRs
19

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • typescript
  • schema-validation
  • type-inference
  • runtime-validation
  • static-types
Stars
43,982
Forks
2,198
Watchers
84
Open issues
47
Contributors
463
Primary language
TypeScript
License
MIT
Repository last updated
Sep 19, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.