# nestjs-validate

> the validate for nestjs

Latest version **0.5.7** (published 2021-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-validate
pnpm add nestjs-validate
yarn add nestjs-validate
bun add nestjs-validate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.7 |
| Published | 2021-09-01 |
| First published | 2019-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 64.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Terence.Sun |
| Maintainers | terencesun |
| Keywords | nestjs, validate, body, params |

## Links

- npm: https://www.npmjs.com/package/nestjs-validate
- Repository: https://github.com/nayo-project/nestjs-validate
- Homepage: https://github.com/nayo-project/nestjs-validate#readme
- Issues: https://github.com/nayo-project/nestjs-validate/issues
- npm.io page: https://npm.io/package/nestjs-validate

## Dependencies (9)

- [rxjs](https://npm.io/package/rxjs.md) ^6.3.3
- [dotenv](https://npm.io/package/dotenv.md) ^8.0.0
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2
- [underscore](https://npm.io/package/underscore.md) ^1.9.1
- [@types/dotenv](https://npm.io/package/@types/dotenv.md) ^6.1.1
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) 8.0.6
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^3.0.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.12
- [express-validator](https://npm.io/package/express-validator.md) ^6.1.1

## Recent versions

- 0.5.7 (latest) — 2021-09-01
- 0.5.6 — 2020-04-12
- 0.5.5 — 2019-08-17
- 0.5.4 — 2019-08-16
- 0.5.3 — 2019-08-16
- 0.5.2 — 2019-08-16
- 0.5.1 — 2019-08-16
- 0.5.0 — 2019-08-16

## README

# nestjs-validate
The validate for nestjs

the document will come soon, you can have a look at the express-validator for learning the validate schema
https://express-validator.github.io/docs/index.html

### version limit
nestjs >= 8.0.0

```
Example:
import * as validate from 'nestjs-validate';

// test.module.ts
@Module({
  imports: [validate.forFeature([
    {path: '/user/create', schema: { username: { isEmail: true } }},
    // the schema is the same as the schema of express-validate
  ])],
  controllers: [TestController],
  providers: [TestService],
})
export class TestModule {}

//  test.service.ts
import { Validate } from 'nestjs-validate';
...
@Post('create')
create(@Req() req, @Res() res, @Validate() validate) {
    console.log(validate);  // if params validate pass, validate's value will be []
    res.end('ok');
}
```

---
_Source: https://npm.io/package/nestjs-validate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
