FindSoftware

class-validator

Validation library for TypeScript and JavaScript classes that checks object properties against rules declared with decorators.

class-validator checks the properties of TypeScript and JavaScript class instances against rules attached as decorators, and it exports the same checks as plain functions for validation without decorators. The README says it works in both the browser and Node.js and uses validator.js internally to perform the checks. It covers custom messages, nested objects, validation groups, whitelisting, and custom validators that run synchronously or asynchronously.

Worth knowing

Schema-based validation without decorators, defined apart from the class, is no longer supported: the README says the feature broke and will not be fixed. A plain object, such as parsed JSON, has to become a class instance before it is validated, for example with class-transformer.

Identity

Status
Active
Maintainer
TypeStack3
First release
20162

Rendering and deploy

Install with
npm4

Releases

Current major version
Pre-1.06
Last release
2026-02-266

Adoption

GitHub stars
11,8535
npm downloads a week
16,955,2268
Contributors
1157
Dependent repositories
56,3469
Dependent packages
3,8549

Why these figures do not compare

Sources

  1. 2026-11-04: links
    github.com/typestack/class-validator
  2. 2026-11-04: First release
    registry.npmjs.org/class-validator
  3. 2026-11-04: Maintainer, License
    github.com/typestack/class-validator/blob/v0.15.1/LICENSE
  4. 2026-11-04: Categories, Runtime, Install with
    github.com/typestack/class-validator/blob/v0.15.1/README.md
  5. 2026-11-04: Written in, GitHub stars
    api.github.com/repos/typestack/class-validator
  6. 2026-11-04: Current major version, Last release
    github.com/typestack/class-validator/releases/tag/v0.15.1
  7. 2026-11-04: Contributors
    api.github.com/repos/typestack/class-validator/contributors
  8. 2026-11-04: npm downloads a week
    api.npmjs.org/downloads/range/2026-10-26:2026-11-01/class-validator
  9. 2026-11-04: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/class-validator

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON