# @uvalidation/plain

> javascript validation library for different runtimes

Latest version **0.9.3** (published 2020-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @uvalidation/plain
pnpm add @uvalidation/plain
yarn add @uvalidation/plain
bun add @uvalidation/plain
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.3 |
| Published | 2020-03-09 |
| First published | 2020-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 12.14.1 |
| Dependencies | 0 |
| Unpacked size | 101.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Serhii Pavlichenko |
| Maintainers | s3141p |
| Keywords | validation, validator, schema, form, forms |

## Links

- npm: https://www.npmjs.com/package/@uvalidation/plain
- Repository: https://github.com/s3141p/uvalidation
- Homepage: https://github.com/s3141p/uvalidation#readme
- Issues: https://github.com/s3141p/uvalidation/issues
- npm.io page: https://npm.io/package/@uvalidation/plain

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.9.3 (latest) — 2020-03-09
- 0.9.2 — 2020-03-09
- 0.9.1 — 2020-03-09
- 0.9.0 — 2020-03-09

## README

[![CircleCI](https://circleci.com/gh/s3141p/uvalidation/tree/master.svg?style=svg)](https://circleci.com/gh/s3141p/uvalidation/tree/master)

## uvalidaiton
> javascript validation library for different runtimes

## Features

Imagine such data structure

<img src="https://raw.githubusercontent.com/s3141p/uvalidation/master/tree.png?s=250" width="300">

Or it's another view

```typescript
const a = {
    b: {
        e: null
    },
    c: {
        f: null,
        g: null,
    },
    d: {
        h: {
            i: null
        }
    },
}
```

As the author I have had some requirements which this library should cover:
1. Validity of a field can depend on that field own value. E.g:
    1. Validity of `b` depends on `b` value
    2. Validity of `e` depends on `e` value
2. Validity of a field can depend on any other field value. E.g:
    1. Validity of `e` depends on `i` and `g` values.
3. Each field can have own error messages.
4. Adding validation should not make me crazy.
5. Validation can be Sync/Async
6. Sync/Async validation can be run separately

## Pros and cons
So main concern which this library addresses is `complexity`.

Currently I don't care about `perfomance`. It even wasn't measured.

Pros:
1. Almost any(?) validation rule can be added.
2. Validators / Relations are very flexible to configuration.
3. Easy to write unit tests.
4. Doesn't have additional dependencies.
5. Can be used in different runtimes - `nodejs` or `browser`.
6. Different bundles:
 - `umd` with `es5`
 - `commonjs` with `es6`
 - `esm` with `es6`

Cons:
1. Sophisticated usage.
2. No built-in validators / relations.
3. No built-in functionality to display errors in form (for browser).

## Examples

[Read the concepts behind](https://s3141p.github.io/uvalidation/#/concepts)

There are multiple drivers:
* [Plain](https://s3141p.github.io/uvalidation/#/plain/driver)
* RxJs TBD

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