# jsonotron-fields

> A library of field type definitions included with the Jsonotron engine.

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

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-06-20 |
| First published | 2020-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 111.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Karl Hulme |
| Maintainers | karlhulme |

## Links

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

## Dependencies (6)

- [ajv](https://npm.io/package/ajv.md) ^6.12.2
- [luhn](https://npm.io/package/luhn.md) ^2.4.0
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [check-types](https://npm.io/package/check-types.md) ^11.1.2
- [jsonotron-errors](https://npm.io/package/jsonotron-errors.md) ^0.2.1
- [jsonotron-schemas](https://npm.io/package/jsonotron-schemas.md) ^0.1.6

## Recent versions

- 0.1.0 (latest) — 2020-06-20
- 0.0.4 — 2020-06-20
- 0.0.3 — 2020-06-20
- 0.0.2 — 2020-06-20
- 0.0.1 — 2020-06-20

## README

# A library of field type definitions included with the Jsonotron engine

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

A library of field type definitions.  This is in a separate library so that it can be included in the Jsonotron engine but also incorporated into documentation pipelines.

> 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-fields --save
```

## Usage

```javascript
const { builtinFieldTypes, combineCustomAndBuiltinFieldTypes, createAjvForFieldTypes, ensureFieldTypesAreValid } = require('jsonotron-fields')

const customFieldTypes = [] // add custom field types here
const combinedFieldTypes = combineCustomAndBuiltinFieldTypes(customFieldTypes, builtinFieldTypes)
const ajv = createAjvForFieldTypes(combinedFieldTypes)
ensureFieldTypesAreValid(ajv, combinedFieldTypes)
```

## 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-fields · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
