Skip to content
Agents tracked: 378 Downloads (7d): 244M down 5.7% GitHub stars: 8.4M VS Code installs: 151M Releases (7d): 407 Agent status: 1 with issues Updated Oct 10, 2026

class-validator

Decorator-based property validation for classes with TypeScript support.

Forms, validation and schemas npm MIT

Used in agent projects
28
0.2% of 12,697 public repos built with AI coding agents
Rank in forms, validation and schemas
#17 of 22
by use in those projects
Downloads
12.3M
npm, last 7 days, class-validator
GitHub stars
11.8K
last push Mar 25, 2026

How class-validator is used

class-validator is a dependency in 28 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (0.2%), #17 of 22 in forms, validation and schemas. The most used alternative there is Zod. Projects that use it most often also use NestJS (89.3%), class-transformer (89.3%), Prettier (82.1%).

Often used with class-validator

NestJS89.3% of class-validator projects · 226.7× more than average
class-transformer89.3% of class-validator projects · 419.9× more than average
Prettier82.1% of class-validator projects · 4.7× more than average
RxJS82.1% of class-validator projects · 59.3× more than average
ts-node82.1% of class-validator projects · 12.1× more than average
Jest75.0% of class-validator projects · 13.6× more than average
tsconfig-paths67.9% of class-validator projects · 100.2× more than average
SuperTest64.3% of class-validator projects · 59.6× more than average

By coding agent

Claude Code0.4% of projects set up for it
Cursor0.4% of projects set up for it
GitHub Copilot0.3% of projects set up for it

Share of public repos configured for each agent that list class-validator as a dependency.

Install

Packagenpm install class-validator
Main stacksTypeScript / JavaScript (27), Next.js (1)
Example projectsalkem-io/server, Hive-Academy/ptah-extension

Alternatives to class-validator

All forms, validation and schemas

Tool Used in agent projectsDownloads / wk GitHub starsLicense
Zod npm
TypeScript-first schema validation library with static type inference.
2,153 (17.0%) 326M 44.1K MIT
React Hook Form npm
Performant form state library using React Hooks with minimal rerenders.
1,021 (8.0%) 54.7M 44.9K MIT
React Hook Form Resolvers npm
Validation resolvers for React Hook Form supporting Zod, Yup, and others.
885 (7.0%) 45.1M 2,264 MIT
Pydantic pypi
Data validation and parsing library using Python type hints.
649 (5.1%) 222M 29K —
Ajv npm
Fast JSON Schema validator for runtime schema validation and serialization.
131 (1.0%) 391M 14.9K MIT
jsonschema pypi
Python implementation of JSON Schema validation for structured data.
129 (1.0%) 125M 4,989 —
Protocol Buffers pypi
Serialization format and code generator for structured data.
75 (0.6%) 154M — 3-Clause BSD License
drizzle-zod npm
Generate Zod validation schemas automatically from Drizzle ORM database schemas.
68 (0.5%) 3.2M 36K Apache-2.0
Is class-validator right for your project? Ask AgentGid →