JSPM

@theflashlabs/ajv-plus

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q80033F
  • License MIT

A maintained and JSON specification-compliant fork of the original `ajv` package.

Package Exports

  • @theflashlabs/ajv-plus
  • @theflashlabs/ajv-plus/dist/ajv.js
  • @theflashlabs/ajv-plus/dist/compile/codegen
  • @theflashlabs/ajv-plus/dist/compile/codegen/index.js
  • @theflashlabs/ajv-plus/dist/core
  • @theflashlabs/ajv-plus/dist/core.js
  • @theflashlabs/ajv-plus/dist/types
  • @theflashlabs/ajv-plus/dist/types/index.js
  • @theflashlabs/ajv-plus/dist/vocabularies/applicator
  • @theflashlabs/ajv-plus/dist/vocabularies/applicator/index.js
  • @theflashlabs/ajv-plus/dist/vocabularies/core/ref
  • @theflashlabs/ajv-plus/dist/vocabularies/core/ref.js
  • @theflashlabs/ajv-plus/dist/vocabularies/discriminator
  • @theflashlabs/ajv-plus/dist/vocabularies/discriminator/index.js
  • @theflashlabs/ajv-plus/dist/vocabularies/format
  • @theflashlabs/ajv-plus/dist/vocabularies/format/index.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/const
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/const.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/enum
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/enum.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitItems
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitItems.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitLength
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitLength.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitProperties
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/limitProperties.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/multipleOf
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/multipleOf.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/pattern
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/pattern.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/required
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/required.js
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/uniqueItems
  • @theflashlabs/ajv-plus/dist/vocabularies/validation/uniqueItems.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@theflashlabs/ajv-plus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Ajv-Plus logo

 

Ajv-Plus JSON schema validator

This is a maintained and JSON specification-compliant fork of the original ajv package. The fastest JSON validator for Node.js and browser.

Supports JSON Schema draft-04/06/07/2019-09/2020-12 (draft-04 support requires ajv-draft-04 package).

build npm npm downloads Coverage Status

Why fork?

  • Ajv-Plus wants to be actively maintained. Support the upcoming JSON Schema specification version too.
  • Ajv-Plus wants to be 100% compliant with the standard JSON Specification.
  • Benchmarks are available at https://theflashlabs.github.io/ajv-plus/dev/bench/

Thanks to Author and contributors of AJV

Thanks to the original author Evgeny Poberezkin and all the contributors of AJV.

Contributing

Please review Contributing guidelines.

Please sponsor Ajv-Plus development

Your support is very important - the funds will be used to develop and maintain Ajv-Plus.

Please sponsor Ajv-Plus via:

Thank you.

Features

Install

To install latest version :

npm install @theflashlabs/ajv-plus

Getting started

In JavaScript:

// or ESM/TypeScript import
import Ajv from "@theflashlabs/ajv-plus"
// Node.js require:
const Ajv = require("@theflashlabs/ajv-plus")

const ajv = new Ajv() // options can be passed, e.g. {allErrors: true}

const schema = {
  type: "object",
  properties: {
    foo: {type: "integer"},
    bar: {type: "string"},
  },
  required: ["foo"],
  additionalProperties: false,
}

const data = {
  foo: 2,
  bar: "abc",
}

const validate = ajv.compile(schema)
const valid = validate(data)
if (!valid) console.log(validate.errors)

Changes history

See https://github.com/theflashlabs/ajv-plus/releases

Code of conduct

Please review and follow the Code of conduct.

License

MIT