# joi-simple

> A simple joi utility wrapper

Latest version **0.0.2** (published 2018-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install joi-simple
pnpm add joi-simple
yarn add joi-simple
bun add joi-simple
```

## 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.0.2 |
| Published | 2018-04-06 |
| First published | 2018-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Mike Schaap |
| Maintainers | mike-schaap |

## Links

- npm: https://www.npmjs.com/package/joi-simple
- Repository: https://github.com/MikeSchaap/joi-simple
- Homepage: https://github.com/MikeSchaap/joi-simple#readme
- Issues: https://github.com/MikeSchaap/joi-simple/issues
- npm.io page: https://npm.io/package/joi-simple

## Dependencies (6)

- [fs](https://npm.io/package/fs.md) 0.0.1-security
- [joi](https://npm.io/package/joi.md) ^13.1.2
- [md5](https://npm.io/package/md5.md) ^2.2.1
- [system](https://npm.io/package/system.md) ^2.0.1
- [JSONPath](https://npm.io/package/JSONPath.md) ^0.11.2
- [md5-file](https://npm.io/package/md5-file.md) ^3.1.1

## Recent versions

- 0.0.2 (latest) — 2018-04-06
- 0.0.1 — 2018-04-06

## README

joi-simple
---
Simple validator, function-based wrapper for `joi`

#### Installation and including in your code

```bash
npm install --save joi-simple
```


```javascript 1.5
var Joi = require('joi'),
    Config = require('joi-simple').Configuration,
    validate = require('joi-simple').Validate;
```

#### Built in validation (email only)

```javascript 1.5

// in your test
expect(validate('maass', 'email')).toBe(false);
expect(validate('acc@dom.com', 'email')).toBe(true);
expect(validate('111', 'email')).toBe(false);
```

#### Expanding validators

```javascript 1.5

Config.set('username', Joi.string().alphanum().min(3).max(30));

// in your test
expect(validate('A', 'username')).toBe(false);
expect(validate('ABDNBD0102030', 'username')).toBe(true);
expect(validate('111111111444444444444444444444444444444444111111111111111111111111111111111111111111111111111111111111111111', 'username')).toBe(false);
```

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