# schemable

> JSON Type Check Library

Latest version **1.3.1** (published 2017-05-05) · MIT license · 0 weekly downloads

## Install

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

## 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.3.1 |
| Published | 2017-05-05 |
| First published | 2017-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tsuba3 |
| Maintainers | tsuba3 |
| Keywords | JSON, type |

## Links

- npm: https://www.npmjs.com/package/schemable
- Repository: https://github.com/tsuba3/schemable
- Homepage: https://github.com/tsuba3/schemable#readme
- Issues: https://github.com/tsuba3/schemable/issues
- npm.io page: https://npm.io/package/schemable

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.3.1 (latest) — 2017-05-05
- 1.3.0 — 2017-05-02
- 1.2.0 — 2017-04-30
- 1.1.0 — 2017-04-30
- 1.0.0 — 2017-04-29

## README

# Schemable
JSON Object Type Check Library

## Usage

```javascript
const user = T.obj({
    name: T.str.atLeast(4),
    pass: T.str.match(/[0-9a-zA-Z]{4,}/),
    age: T.int.atLeast(0),
    sex: T.oneOf(["male", "female"])
})

user.validate({
    name: "Beckey",
    pass: "P4SS",
    age: 19,
    sex: "female"
})

assert.throws(() => user.validate({
    name: "Beckey",
    pass: "P",
    age: 19,
    sex: "female"
}))
```

For more detail, see [example.js](https://github.com/tsuba3/schemable/blob/master/example.js)

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