Installation¶
Requirements¶
- npm version 6 or higher
- Node.js
Installing the Package¶
Note
It's important to use at least npm@6 when using class-validator. From npm@6 the dependency tree is flattened, which is required by class-validator to function properly.
Basic Setup¶
- Import the necessary decorators:
- Enable decorators in your
tsconfig.json:
You're now ready to start using class-validator in your project!