# conformity

> JSON validation middleware for express.js, kitchensink, etc

Latest version **0.0.3** (published 2018-02-23) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-02-23 |
| First published | 2015-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Van Nguyen |
| Maintainers | thegoleffect |
| Keywords | validation, conform, query, param, path, payload, json, validator, schema, joi |

## Links

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

## Dependencies (2)

- [joi](https://npm.io/package/joi.md) ^7.0.1
- [xss](https://npm.io/package/xss.md) ^0.3.7

## 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

- 0.0.3 (latest) — 2018-02-23
- 0.0.2 — 2018-02-23
- 0.0.1-pre5 — 2016-01-28
- 0.0.1-pre4 — 2016-01-12
- 0.0.1-pre3 — 2016-01-12
- 0.0.1-pre2 — 2015-12-22
- 0.0.1-pre — 2015-12-22

## README

# Conformity - HTTP Parameter Validation Middleware

[![Dependency Status](https://david-dm.org/thegoleffect/conformity.svg)](https://david-dm.org/thegoleffect/conformity.svg)
[![devDependency Status](https://david-dm.org/thegoleffect/conformity/dev-status.svg)](https://david-dm.org/thegoleffect/conformity/dev-status.svg)

Conformity is a JSON validation middleware for express.js. It lets you perform path, query, payload, and response validation without polluting your handler code. Additionally, it performs XSS html escaping automatically.

## Getting Started

```
npm install --save conformity
```


```
var Express = require('express');
var Conformity = require('conformity');
var Joi = Conformity.validator;

var app = Express();

// CONFORMITY USAGE:
app.use(Conformity.validate());
var IndexHandler = function (req, res) {
    return 'Hello! ' + req.params.name;
}
IndexHandler.validate = {
    path: {
        name: Joi.string().required()
    }
};

app.get('/:name', IndexHandler);

app.listen(3000);
```

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