# class-validator

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


Source: https://findsoftware.frbit.cloud/class-validator/
Last reviewed: 2026-11-04
Listed since: 2026-11-04

## Record

### Links

- repository: https://github.com/typestack/class-validator

### Identity

- status: active
- maintainer: TypeStack
- maintainerType: unknown
- parent: unknown
- firstRelease: 2016
- hqCountry: unknown

### Kind

- category: library
- hosting: node
- language: javascript
- runtime: node
- runtimeMin: unknown
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: not applicable
- renderingModes: not applicable
- installMethod: npm

### License

- licenseModel: open-source
- license: MIT

### Releases

- currentMajor: 0
- latestReleaseDate: 2026-02-26

### Adoption

- githubStargazers: 11853
- packagistDownloads: not applicable
- npmWeeklyDownloads: 16955226
- contributors: 115
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 56346
- dependentPackages: 3854

### Sources

- urls: https://github.com/typestack/class-validator (read 2026-11-04)
- firstRelease: https://registry.npmjs.org/class-validator (read 2026-11-04)
- maintainer: https://github.com/typestack/class-validator/blob/v0.15.1/LICENSE (read 2026-11-04)
- category: https://github.com/typestack/class-validator/blob/v0.15.1/README.md (read 2026-11-04)
- language: https://api.github.com/repos/typestack/class-validator (read 2026-11-04)
- runtime: https://github.com/typestack/class-validator/blob/v0.15.1/README.md (read 2026-11-04)
- installMethod: https://github.com/typestack/class-validator/blob/v0.15.1/README.md (read 2026-11-04)
- license: https://github.com/typestack/class-validator/blob/v0.15.1/LICENSE (read 2026-11-04)
- currentMajor: https://github.com/typestack/class-validator/releases/tag/v0.15.1 (read 2026-11-04)
- latestReleaseDate: https://github.com/typestack/class-validator/releases/tag/v0.15.1 (read 2026-11-04)
- githubStargazers: https://api.github.com/repos/typestack/class-validator (read 2026-11-04)
- contributors: https://api.github.com/repos/typestack/class-validator/contributors (read 2026-11-04)
- npmWeeklyDownloads: https://api.npmjs.org/downloads/range/2026-10-26:2026-11-01/class-validator (read 2026-11-04)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/class-validator (read 2026-11-04)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/class-validator (read 2026-11-04)

## Notes

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.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
