# value-validate

> value validate tool

Latest version **1.1.2** (published 2017-08-16) · ISC license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2017-08-16 |
| First published | 2017-03-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cedcn |

## Links

- npm: https://www.npmjs.com/package/value-validate
- npm.io page: https://npm.io/package/value-validate

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.1.2 (latest) — 2017-08-16
- 1.1.1 — 2017-08-16
- 1.0.1 — 2017-03-28
- 1.0.0 — 2017-03-28

## README

## value-validate
[![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/value-validate)

Verify that a value matches the rules.

###Install
```bash
$ npm install value-validate --save
# or
$ yarn add value-validate
```
###Usage

```javascript
import { validation } from 'value-validate';

/**
 *
 * @param  {String}         value   String that need to be validated
 * @param  {Object|String}  rules   Validation rules
 */

validation(
  'cedcn@qq.com',
  ['required', { type: 'email', msg: 'Please input the correct email format!'}],
  result => console.log(result);
);
```

####Rules
+ `required`
+ `email`
+ `phone`
+ `number`
+ `number-gt-#{number}`
+ `number-it-#{number}`
+ `number-gts-#{number}`
+ `number-its-#{number}`

####Callback

 *retrun* { isPass: [Bool], mag: [String] }

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