# jsonotron-schemas

> A library of schemas used by the Jsonotron system.

Latest version **0.1.7** (published 2020-06-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install jsonotron-schemas
pnpm add jsonotron-schemas
yarn add jsonotron-schemas
bun add jsonotron-schemas
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2020-06-20 |
| First published | 2020-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 30.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Karl Hulme |
| Maintainers | karlhulme |

## Links

- npm: https://www.npmjs.com/package/jsonotron-schemas
- Repository: https://github.com/karlhulme/jsonotron-schemas
- Homepage: https://github.com/karlhulme/jsonotron-schemas#readme
- Issues: https://github.com/karlhulme/jsonotron-schemas/issues
- npm.io page: https://npm.io/package/jsonotron-schemas

## Dependencies (1)

- [jsonotron-errors](https://npm.io/package/jsonotron-errors.md) ^0.2.0

## Recent versions

- 0.1.7 (latest) — 2020-06-20
- 0.1.6 — 2020-06-20
- 0.1.5 — 2020-06-14
- 0.1.4 — 2020-06-14
- 0.1.3 — 2020-06-14
- 0.1.2 — 2020-06-14
- 0.1.1 — 2020-06-14
- 0.1.0 — 2020-06-13

## README

# A library of schemas used by the Jsonotron system.

![](https://github.com/karlhulme/jsonotron-schemas/workflows/CD/badge.svg)
[![npm](https://img.shields.io/npm/v/jsonotron-schemas.svg)](https://www.npmjs.com/package/jsonotron-schemas)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

A library of schemas used by the Jsonotron system to validate document types, field types and role types.

The schemas allow the use of functions to be added to the JS objects via the customTypeOf keyword.  For example, on a document type, the implementation of a constructor can be included in the definition because of the following definition:

```javascript
ctor: {
  type: 'object',
  description: 'A mechanism for constructing new instances of the document type.',
  additionalProperties: false,
  properties: {
    parameters: { /* edited out */ }
    implementation: { customTypeOf: 'function' } // <-- function inline with the JSON Schema.
  },
  required: ['parameters', 'implementation']
}
```

> This package is part of the Jsonotron system.
>
> Jsonotron is...
> * a small set of components for building a **NodeJS microservice**
> * for storing, patching and querying **JSON documents**
> * stored in a schemaless/NoSQL **database**
> * that have known, enforceable, and **evolving schemas**.
>
> **Visit https://karlhulme.github.io/jsonotron/ for details on how to get started.**

## Installation

```bash
npm install jsonotron-schemas --save
```

## Usage

```javascript
const { docTypeSchema, fieldTypeSchema, roleTypeSchema } = require('jsonotron-schemas')

console.log(docTypeSchema)
console.log(fieldTypeSchema)
console.log(roleTypeSchema)
```

## Development

Code base adheres to the rules chosen by https://standardjs.com/.  Code is formatted with 2 spaces.

Tests are written using Jest with 100% coverage.

```javascript
npm test
```

## Continuous Deployment

Any commits to master will cause the library to be re-published.

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