41 lines
1.2 KiB
Markdown
41 lines
1.2 KiB
Markdown
# ajv-draft-04
|
|
|
|
Ajv with JSON Schema draft-04 support
|
|
|
|
[](https://github.com/ajv-validator/ajv-draft-04/actions/workflows/build.yml)
|
|
[](https://www.npmjs.com/package/ajv-draft-04)
|
|
[](https://coveralls.io/github/ajv-validator/ajv-draft-04?branch=master)
|
|
[](https://gitter.im/ajv-validator/ajv)
|
|
[](https://github.com/sponsors/epoberezkin)
|
|
|
|
## Usage
|
|
|
|
You need to install both ajv and this package (to allow upgrading ajv without upgrading this package):
|
|
|
|
```shell
|
|
npm i ajv ajv-draft-04
|
|
```
|
|
|
|
```javascript
|
|
// ESM/TypeScript import
|
|
import Ajv from "ajv-draft-04"
|
|
// Node.js require:
|
|
const Ajv = require("ajv-draft-04")
|
|
|
|
const ajv = new Ajv()
|
|
```
|
|
|
|
See [ajv site](https://ajv.js.org) for documentation.
|
|
|
|
## Tests
|
|
|
|
```bash
|
|
npm install
|
|
git submodule update --init
|
|
npm test
|
|
```
|
|
|
|
## License
|
|
|
|
[MIT](https://github.com/ajv-validator/ajv-formats/blob/master/LICENSE)
|