# bs-awesomize

> A ReasonML implementation of the Awesomize validation and data scrubbing library.

Latest version **2.0.0** (published 2020-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install bs-awesomize
pnpm add bs-awesomize
yarn add bs-awesomize
bun add bs-awesomize
```

## 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 | 2.0.0 |
| Published | 2020-08-19 |
| First published | 2018-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 103.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nathan Sculli |
| Maintainers | acbarnett, carmonw, scull7 |

## Links

- npm: https://www.npmjs.com/package/bs-awesomize
- Repository: git@github.com:scull7/bs-awesomize
- npm.io page: https://npm.io/package/bs-awesomize

## Dependencies (1)

- [bs-platform](https://npm.io/package/bs-platform.md) ^8.2.0

## Recent versions

- 2.0.0 (latest) — 2020-08-19
- 1.6.0 — 2018-08-06
- 1.5.0 — 2018-07-27
- 1.4.11 — 2018-05-09
- 1.4.10 — 2018-05-08
- 1.4.9 — 2018-05-08
- 1.4.8 — 2018-05-08
- 1.4.7 — 2018-05-06
- 1.4.6 — 2018-05-06
- 1.4.5 — 2018-05-06
- 1.4.4 — 2018-05-06
- 1.4.3 — 2018-05-06
- 1.4.2 — 2018-05-06
- 1.4.1 — 2018-05-05
- 1.4.0 — 2018-05-05
- … 4 more at https://npm.io/package/bs-awesomize/versions

## README

[![Build Status](https://www.travis-ci.org/scull7/bs-awesomize.svg?branch=master)](https://www.travis-ci.org/scull7/bs-awesomize)
[![Coverage Status](https://coveralls.io/repos/github/scull7/bs-awesomize/badge.svg?branch=master)](https://coveralls.io/github/scull7/bs-awesomize?branch=master)

# bs-awesomize
A ReasonML implementation of the Awesomize library for data validation / scrubbing

# Why?
We use Awesomize to ensure that data which comes into our system
fits the proper shape and is within expected constraints.  There are several
other libraries which aim to handle this, however, translating them to
ReasonML proved problematic.  Also, the Awesomize library is asynchronous by
default which allows much greater flexibility in validation / scrubbing code.

# Status

This library can be considered production ready.

# Installation

Inside of a BuckleScript project:
```sh
yarn add bs-awesomize
```

Then add `bs-awesomize` to your `bs-dependencies` in your `bsconfig.json`
```json
{
  "bs-dependencies": [ "bs-awesomize" ]
}
```

# Usage

In order to use awesomize you will want to provide a "schema" which
consists of a map of `fields` to `field definitions`.

## Field definition
```reason
type maybe = option(Js.Json.t);
type jsonMap = Belt.Map.String.t(maybe);

type definition = {
  read: Js.Dict.t(Js.Json.t) => Js.Promise.t(maybe),
  sanitize: option((maybe, jsonMap) => Js.Promise.t(maybe)),
  validate: list((maybe, jsonMap) => Js.Promise.t(option(string))),
  normalize: option((maybe, jsonMap) => Js.Promise.t(maybe)),
};
```

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