在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ajv-validator/ajv开源软件地址:https://github.com/ajv-validator/ajv开源编程语言:TypeScript 97.8%开源软件介绍:
Ajv JSON schema validatorThe 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) and JSON Type Definition RFC8927. Ajv sponsorsContributingMore than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. Please review Contributing guidelines and Code components. DocumentationAll documentation is available on the Ajv website. Some useful site links:
Please sponsor Ajv developmentSince I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. Please sponsor Ajv via:
Thank you. Open Collective sponsorsPerformanceAjv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks:
Performance of different validators by json-schema-benchmark: Features
InstallTo install version 8:
Getting startedTry it in the Node.js REPL: https://runkit.com/npm/ajv In JavaScript: // or ESM/TypeScript import
import Ajv from "ajv"
// Node.js require:
const Ajv = require("ajv")
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: 1,
bar: "abc"
}
const validate = ajv.compile(schema)
const valid = validate(data)
if (!valid) console.log(validate.errors) Learn how to use Ajv and see more examples in the Guide: getting started Changes historySee https://github.com/ajv-validator/ajv/releases Please note: Changes in version 8.0.0 Code of conductPlease review and follow the Code of conduct. Please report any unacceptable behaviour to [email protected] - it will be reviewed by the project team. Security contactTo report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. Open-source software supportAjv is a part of Tidelift subscription - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论