# i-validator

> validate so easy

Latest version **1.0.2** (published 2017-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install i-validator
pnpm add i-validator
yarn add i-validator
bun add i-validator
```

## 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.2 |
| Published | 2017-10-13 |
| First published | 2017-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ishanyang |
| Maintainers | ishanyang |
| Keywords | validator, validate |

## Links

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

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-10-13
- 1.0.1 — 2017-10-11
- 1.0.0 — 2017-10-11

## README

# i-validator  

*validate so easy(3.28kb)*

```Javascript
npm install i-validator
```

# node
```Javascript
var iValidator = require('i-validator')

var validatorArr = [
  [
    {value:123,key:"name"},
    {"validatorFn":function(v) { return typeof v ==="string"},"errorMessage":"name can only be a string"},
    {"validatorFn":function (v) {return v.length>=3 && v.length<=8},"errorMessage":"the length of name is 3-8"}
  ],
  [
    {value:'j',key:"name"},
    {"validatorFn":function(v) { return typeof v ==="string"},"errorMessage":"name can only be a string"},
    {"validatorFn":function (v) {return v.length>=3 && v.length<=8},"errorMessage":"the length of name is 3-8"}
  ],
  [
    {value:'john',key:"name"},
    {"validatorFn":function(v) { return typeof v ==="string"},"errorMessage":"name can only be a string"},
    {"validatorFn":function (v) {return v.length>=3 && v.length<=8},"errorMessage":"the length of name is 3-8"}
  ],
]

var result = iValidator(validatorArr);

// result
[ { key: 'name',
    errormessageArr: [ 'name can only be a string', 'the length of name is 3-8' ] },
  { key: 'name',
    errormessageArr: [ 'the length of name is 3-8' ] } ]
```

# browserify
```Javascript
<script src="dist/i-validator.js"></script>
<script>
var iValidator = require('i-validator')
</script>
```

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