# json-scheme-tools

> Purpose: Create, validate and fix objects according scheme object

Latest version **1.0.2** (published 2017-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-scheme-tools
pnpm add json-scheme-tools
yarn add json-scheme-tools
bun add json-scheme-tools
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-11-02 |
| First published | 2017-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | scriptPilot |
| Maintainers | scriptpilot |

## Links

- npm: https://www.npmjs.com/package/json-scheme-tools
- npm.io page: https://npm.io/package/json-scheme-tools

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) ^4.0.0

## Recent versions

- 1.0.2 (latest) — 2017-11-02
- 1.0.1 — 2017-11-02
- 1.0.0 — 2017-11-02
- 0.4.0 — 2017-07-16
- 0.3.0 — 2017-07-16
- 0.2.0 — 2017-07-16
- 0.1.4 — 2017-07-16
- 0.1.3 — 2017-07-16
- 0.1.2 — 2017-07-16
- 0.1.0 — 2017-07-16

## README

# JSON Scheme Tools

Purpose: Create, validate and fix objects according scheme object

Example scheme object:
{
  "item": {
    "property": "value"
  }
}

Allowed properties:
- type: text/array/object/boolean
- allow: array
- regexp: string
- props: object
- default: text/array/object/boolean

Rules:
1. Item must contain exact one property of type, allow, regexp or props
2. Props must contain a scheme object itself
3. Default is optional, must be valid itself and is allowed together with type, allow and regexp
4. Default is required for allow and regexp
5. Other props are not allowed

Functions:
- create(scheme, saveToFile)
- validate(scheme, objectSource)
- fix(scheme, objectSource)

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