# aschema

> JSON schema validator

Latest version **3.1.0** (published 2020-05-10) · MIT license · 0 weekly downloads

## Install

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

## 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 | 3.1.0 |
| Published | 2020-05-10 |
| First published | 2016-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Taka Okunishi |
| Maintainers | okunishinishi |
| Keywords | JSON Schema, validator |

## Links

- npm: https://www.npmjs.com/package/aschema
- Repository: https://github.com/a-labo/aschema
- Homepage: https://github.com/a-labo/aschema#readme
- Issues: https://github.com/a-labo/aschema/issues
- npm.io page: https://npm.io/package/aschema

## Dependencies (3)

- [tv4](https://npm.io/package/tv4.md) ^1.2.7
- [uuid](https://npm.io/package/uuid.md) ^8.0.0
- [iftype](https://npm.io/package/iftype.md) ^4.0.9

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 3.1.0 (latest) — 2020-05-10
- 3.0.3 — 2019-08-02
- 3.0.2 — 2019-07-04
- 3.0.0 — 2019-02-24
- 2.0.4 — 2016-08-23
- 2.0.3 — 2016-08-21
- 2.0.2 — 2016-08-21
- 2.0.1 — 2016-08-21
- 2.0.0 — 2016-08-21
- 1.0.9 — 2016-08-17
- 1.0.8 — 2016-08-01
- 1.0.7 — 2016-07-25
- 1.0.6 — 2016-07-12
- 1.0.5 — 2016-07-11
- 1.0.4 — 2016-07-11
- … 4 more at https://npm.io/package/aschema/versions

## README

aschema
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/a-labo/aschema
[bd_travis_url]: http://travis-ci.org/a-labo/aschema
[bd_travis_shield_url]: http://img.shields.io/travis/a-labo/aschema.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/a-labo/aschema
[bd_travis_com_shield_url]: https://api.travis-ci.com/a-labo/aschema.svg?token=
[bd_license_url]: https://github.com/a-labo/aschema/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/a-labo/aschema
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/a-labo/aschema.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/a-labo/aschema.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/a-labo/aschema
[bd_gemnasium_shield_url]: https://gemnasium.com/a-labo/aschema.svg
[bd_npm_url]: http://www.npmjs.org/package/aschema
[bd_npm_shield_url]: http://img.shields.io/npm/v/aschema.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

JSON schema validator

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install aschema --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

const aschema = require('aschema')

// Define a schema object
const userSchema = aschema({
  title: 'User',
  description: 'A user',
  type: 'object',
  properties: {
    id: {
      description: 'The unique identifier for a account',
      type: 'integer'
    },
    accountName: {
      description: 'Name of the account',
      type: 'string'
    }
  },
  required: [
    'id',
    'name'
  ]
})

// Execute validation
let error = userSchema.validate({
  name: 'foo'
})

if (error) {
  console.error(error)
} else {
  console.log('no error!')
}

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/a-labo/aschema/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [a-labo][a_labo_url]

[a_labo_url]: https://github.com/a-labo

<!-- Links End -->

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