# svv

> Simple Value Validator

Latest version **0.3.0** (published 2018-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install svv
pnpm add svv
yarn add svv
bun add svv
```

## 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.0 |
| Published | 2018-08-31 |
| First published | 2017-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Krisztian Nagy |
| Maintainers | chrisakakay |

## Links

- npm: https://www.npmjs.com/package/svv
- Repository: https://github.com/chrisakakay/svv
- Issues: https://github.com/chrisakakay/svv/issues
- npm.io page: https://npm.io/package/svv

## Recent versions

- 0.3.0 (latest) — 2018-08-31
- 0.2.3 — 2018-01-16
- 0.2.2 — 2018-01-16
- 0.2.1 — 2018-01-16
- 0.2.0 — 2018-01-16
- 0.1.0 — 2017-12-07
- 0.0.1 — 2017-08-31

## README

# Simple Value Validator

A small module the validate values easily (opinionated).

Install:

```bash
yarn add svv
// or
npm install svv
```

Usage example:

```javascript
import { Runner, Item } from 'svv';

const validator = new Runner();

validator.all([
    new Item('content', property1).required(),
    new Item('category', property2).requiredIf(property1 === 'something')
], { /* options */ })
.then((result) => {
    if (result.valid) {
       // valid
    } else {
       // invalid
       //
       // checking if the error is specific to a field:
       // result.errors.has('content') => boolean // content has errors
       //
       // checking the first error message for a field
       // result.errors.first('content') => 'The content field is required'
    }
});
```

[Homepage](https://chrisakakay.github.io/svv)

[API DOCS v0.2.3](https://chrisakakay.github.io/svv/svv/0.2.3)

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