# typestack/class-validator

Decorator-based property validation for classes.

Repository: https://github.com/typestack/class-validator
Canonical: https://ross.abutalabs.com/products/class-validator
Language: TypeScript
License: MIT
License Family: permissive
Topics: validation, validator, decorators, typescript
Last push: 2026-03-25T22:18:47+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 74, release rhythm 60, longevity 100
- inputs: {"age_days": 3987, "days_push": 161, "days_rel": 188, "gap_med": 46.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 11833, forks 847 (observed 2026-08-28T04:10:50.096710+00:00)

## What it is
A TypeScript library providing decorator-based and non-decorator-based property validation for classes, built on validator.js. It supports nested objects, arrays, conditional validation, validation groups, and custom validators, and works in both browser and Node.js environments.

## Use cases
- validate request DTOs in a NestJS API
- validate class properties with decorators in TypeScript
- validate nested objects and arrays before persisting
- reject invalid form input on the server
- add custom validation rules to class fields
- validate plain objects against a class schema

## When to choose
- you use TypeScript classes and want declarative, decorator-based validation
- you need rich built-in rules plus custom validators, groups, and nested object validation
- you want validation that works in both Node.js and the browser

## When to avoid
- you prefer schema-based validation without decorators (e.g. Zod or Joi)
- your project is plain JavaScript without decorator support
- you only need lightweight runtime type checking

## Facets
- artifact type: library
- maturity: stable
- function: form-handling, developer-tools
- domain: web-development, backend, frontend, developer-tools
- platform: browser, cross-platform
- tags: validation, decorators, class-validator, typescript, dto-validation, validatorjs, nodejs

## Member repositories
- typestack/class-validator (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:50.096710+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:15:17.631737+00:00, confidence not recorded.
  - readme: https://github.com/typestack/class-validator (fetched 2026-08-28T04:10:50.096710+00:00, sha 560b6d3b3fdf)
  - registry_npm: https://registry.npmjs.org/class-validator (fetched 2026-08-29T08:13:32.385653+00:00, sha a0e82c5b3aec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
