# data-rules

> data rules

Latest version **0.1.1** (published 2017-12-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install data-rules
pnpm add data-rules
yarn add data-rules
bun add data-rules
```

## 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.1.1 |
| Published | 2017-12-14 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ReAlign |
| Maintainers | realign |
| Keywords | data, validator, rules |

## Links

- npm: https://www.npmjs.com/package/data-rules
- Repository: https://github.com/ReAlign/data-rules
- Homepage: https://github.com/ReAlign/data-rules#readme
- Issues: https://github.com/ReAlign/data-rules/issues
- npm.io page: https://npm.io/package/data-rules

## Dependencies (3)

- [n-tools](https://npm.io/package/n-tools.md) ^0.1.2
- [n-s-logs](https://npm.io/package/n-s-logs.md) ^0.2.0
- [n-validator](https://npm.io/package/n-validator.md) ^0.2.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-12-14
- 0.1.0 — 2017-12-13
- 0.0.8 — 2017-12-13
- 0.0.7 — 2017-12-13
- 0.0.6 — 2017-12-13
- 0.0.5 — 2017-12-13
- 0.0.4 — 2017-12-11
- 0.0.3 — 2017-12-11
- 0.0.2 — 2017-12-10
- 0.0.1 — 2017-12-09

## README

# data-rules

## Usage

```javascript
const _dr = require('data-rules');

const obj = {
    name: 'realign',
    age: 120
};

const rules = {
    name: {
        type: 'str',
        regex: { min: 1, max: 10 }
    },
    age: {
        type: 'int',
        regex: { min: 1, max: 100 }
    }
};

let res = _dr(obj, rules);

/**
{
 "success": false,
 "message": {
  "name": [],
  "age": [
   {
    "key": "min",
    "msg": "length error"
   }
  ]
 }
}
 * /
```

todo

* [ ] caalback

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