# validator-iso-fork

> Universal (a.k.a isomorphic) validator

Latest version **0.3.8** (published 2018-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install validator-iso-fork
pnpm add validator-iso-fork
yarn add validator-iso-fork
bun add validator-iso-fork
```

## 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.3.8 |
| Published | 2018-06-01 |
| First published | 2018-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 42.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | 福露露 |
| Maintainers | wangdahoo |

## Links

- npm: https://www.npmjs.com/package/validator-iso-fork
- Repository: https://github.com/UserHuRu/validator-iso
- Homepage: https://github.com/UserHuRu/validator-iso#readme
- Issues: https://github.com/UserHuRu/validator-iso/issues
- npm.io page: https://npm.io/package/validator-iso-fork

## Recent versions

- 0.3.8 (latest) — 2018-06-01

## README

# validator-iso
> Universal (a.k.a isomorphic) validator

### Install

```bash
$ npm i validator-iso
```

### How to Use

```js
function handler (errMsg) {
  console.log(errMsg)
}

var rules = [
  {
    field: 'name', // 字段名
    fieldDesc: '姓名', // 字段名描述
    re: /^[\u4e00-\u9fa5]{2,10}$/, // 正则验证
    message: '请填写中文名，长度为2~10个字符', // 错误提示
    isRequired: true, // 该字段是否必须验证
    callback: handler
  },
  {
    field: 'mobile', // 字段名
    fieldDesc: '手机号', // 字段名描述
    re: /^1\d{10}$/, // 正则验证
    message: '请填写正确的手机号', // 错误提示
    isRequired: true, // 该字段是否必须验证
    callback: handler
  }
]

var form = {
  name: '令狐冲',
  mobile: '13851795179'
}

validator = new Validator(rules)

if (validator.run(form)) {
  console.log('表单验证通过')
}
```

### API

TBD

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