# joi-validate-utils

> A joi-router's vlidate util

Latest version **1.0.0** (published 2017-10-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install joi-validate-utils
pnpm add joi-validate-utils
yarn add joi-validate-utils
bun add joi-validate-utils
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-10-25 |
| First published | 2017-10-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yanghangbin |

## Links

- npm: https://www.npmjs.com/package/joi-validate-utils
- Repository: https://github.com/HangbinYang/joi-validate-utils
- Homepage: https://github.com/HangbinYang/joi-validate-utils#readme
- Issues: https://github.com/HangbinYang/joi-validate-utils/issues
- npm.io page: https://npm.io/package/joi-validate-utils

## Recent versions

- 1.0.0 (latest) — 2017-10-25

## README

# joi-validate-utils
A joi-router's validate utils

##### Denpendency
koa-usual-response

```
const koa = require('koa')
const response = require('koa-usual-response')
const app = new koa()

app.use(response())

app.use(ctx => {
  /** bad request */
  ctx.bad(...)

  /** success */
  ctx.success(...)

  /** error */
  ctx.error(...)

})

```

##### API
``` Javascript
const router = require('koa-joi-router')()
const utils = require('joi-validate-utils')

router.route({
    method: 'post',
    path: '/validation',
    validate: utils.jsonBody({
        name: Joi.string().required()
    }),
    handler: [
        utils.invalidHandler,
        somecontroller.somemethod
    ]
})

```

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