# syncano-validation

> > Client/Server side validation library based on Laravel.

Latest version **0.1.2** (published 2017-08-11) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install syncano-validation
pnpm add syncano-validation
yarn add syncano-validation
bun add syncano-validation
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-08-11 |
| First published | 2017-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | eyedea |

## Links

- npm: https://www.npmjs.com/package/syncano-validation
- npm.io page: https://npm.io/package/syncano-validation

## Dependencies (6)

- [chai](https://npm.io/package/chai.md) ^3.5.0
- [is_js](https://npm.io/package/is_js.md) ^0.9.0
- [release](https://npm.io/package/release.md) ^1.3.3
- [syncano-server](https://npm.io/package/syncano-server.md) ^0.8.1
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [lodash.snakecase](https://npm.io/package/lodash.snakecase.md) ^4.1.1

## Recent versions

- 0.1.2 (latest) — 2017-08-11
- 0.1.0 — 2017-08-11

## README

# Syncano Validator

> Client/Server side validation library based on Laravel.

[![XO code style][xo-badge]][xo]
[![CircleCI][circleci-badge]][circleci]
[![codecov][codecov-badge]][codecov]

[xo]: https://github.com/sindresorhus/xo
[xo-badge]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg
[circleci]: https://circleci.com/gh/eyedea-io/syncano-validator/tree/devel
[circleci-badge]: https://circleci.com/gh/eyedea-io/syncano-validator.svg?style=shield&circle-token=4f0733cbf425699a9ca0bc95d44ade178e5a7abd
[codecov]: https://codecov.io/gh/eyedea-io/syncano-validator
[codecov-badge]: https://codecov.io/gh/eyedea-io/syncano-validator/branch/master/graph/badge.svg

```
$ npm install syncano-validation
```

## How to use

```js
import {validate} from 'syncano-validator'

const data = {
  firstName: 'John',
  lastName: 'Doe',
  username: 'john.doe'
  email: 'john.doe@example.com',
  age: 43,
  gender: 'male'
}

const rules = {
  firstName: 'required|min:2',
  lastName: 'required|min:2',
  username: 'required|unique:users,username',
  email: 'required|email',
  age: 'required|numeric|min:18',
  gender: 'in:male,female'
}

validate(data, rules)
  .then(() => {
    // All params valid! Continue code...
  })
  .catch(errors => {
    // Handle errors
  })
```

## TODO:

* After (Date)
* Alpha Dash
* Before (Date)
* Between
* Confirmed
* Date
* Date Format
* Different
* Dimensions (Image Files)
* E-Mail
* File
* Filled
* Image (File)
* In Array
* IP Address
* JSON
* MIME Types
* MIME Type By File Extension
* Nullable
* Not In
* Present
* Regular Expression
* Same
* Size
* String
* Timezone
* Unique (Database)

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