qmetrics.net

Zod

TypeScript-first runtime schema validation library

Zod screenshot

Zod lets you define schemas in TypeScript, parse untrusted input, and get typed, validated results with inferred static types.

Overview

Zod is a validation library centered on TypeScript. You describe shapes—from simple strings to nested objects—and parse data through methods such as parse or safeParse. Successful parsing returns a typed deep clone; failures yield structured ZodError details or a discriminated safeParse result without throwing.

The API is immutable: chaining methods returns new schema instances. It runs in Node.js and modern browsers, ships a small gzipped core, works with plain JavaScript as well as TypeScript, and can emit JSON Schema. An ecosystem of form libraries, API tooling, and adapters builds on it.

For hot paths, optional ahead-of-time compilation via z.compile can speed validation while invalid inputs fall back to the regular parser for consistent errors. Global compilation can be toggled; CSP or jitless environments disable automatic compilation. Types are extracted with z.infer, and separate input/output types exist when transforms change shapes.

The project documents strict TypeScript tsconfig requirements, publishes on npm and jsr, and offers doc search tooling for agents. Maintenance targets recent TypeScript releases.

Key features

  • Schema parse and safeParse APIs
  • Static types via z.infer
  • Structured ZodError reporting
  • Optional AOT compile fast path
  • JSON Schema conversion
  • No runtime dependencies
  • Async parse variants
  • Large adapter ecosystem

Use cases

  • API request and response validation
  • Form input checking in TypeScript
  • Config and env parsing
  • Shared types between client and server

Tags

Similar software

axios

Promise-based HTTP client for browser and Node.js

Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.

★ 109.5k⟳ 2 days agoMIT

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

OmniRoute

OpenAI-compatible AI gateway with provider routing

OmniRoute exposes one endpoint that routes chat requests across many LLM providers with quota-aware fallback and compression.

★ 90.7k⟳ todayMIT

Hoppscotch

Web, desktop and CLI API development ecosystem

Hoppscotch lets developers send HTTP, WebSocket, GraphQL, and related API requests from a lightweight client. Collections, environments, teams, and sync help organize testing across devices.

★ 81k⟳ 5 days agoMIT
Open Source Alternative to:Postman

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

JSON Server

Zero-code mock REST API from JSON data files

JSON Server turns a JSON or JSON5 database file into a REST API for local prototyping. It supports filtering, sorting, pagination, embedding relations, and static assets.

★ 75.7k⟳ 8 months agoMIT