Speed up validation in an existing TypeScript app that already uses Zod schemas.
Compile schemas ahead of time so large projects with many schemas avoid runtime validation overhead.
Keep libraries like tRPC, Hono, and React Hook Form working unchanged while gaining faster validation.
Generate optimized validation files from the command line when a project has no bundler.
| gajus/zod-compiler | dev-ocr/polymarket-arbitrage-trading-bot | ant-design/ant-design-cli | |
|---|---|---|---|
| Stars | 213 | 213 | 216 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 4/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Mostly automatic once the bundler plugin is added, explicit or CLI modes need a little more wiring.
This is a tool for software developers who use a popular library called Zod. Zod lets a programmer describe the exact shape that incoming data should have, for example that a user record must contain a name between 1 and 100 characters, a valid email, and an age that is a whole number. The program then checks real data against that description and rejects anything that does not fit. This checking is called validation. The problem zod-compiler addresses is speed. Normally Zod figures out how to do this checking while your program is running, which costs time. zod-compiler does that work ahead of time, during the build step when the code is packaged up, and turns each schema into a fast, direct validation function. The README claims this makes validation 2 to 75 times faster, with no changes to your existing code. It says it has been tested in large projects with tens of thousands of schemas. There are three ways to use it. In the default automatic mode, a plugin scans your project at build time, finds every schema, and compiles it without you importing anything new. A second mode lets you opt in explicitly by wrapping specific schemas with a compile function. A third option is a command-line tool that generates the optimized files directly, useful if you do not use a bundler. A key promise is that the full Zod interface keeps working. The optimized methods are attached to the original schema object, so other libraries that accept Zod schemas, such as tRPC, Hono, and React Hook Form, continue to work unchanged. The tool plugs into many common build systems, including Vite, webpack, esbuild, Rollup, and Bun, and offers options to control which files are processed.
A build-time compiler that turns Zod validation schemas into fast, direct-check functions, claiming up to 75x faster runtime validation with no code changes.
Mainly TypeScript. The stack also includes TypeScript, Zod, Vite.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.