Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 8, 2024 via pnpm
Package summary
Share
0
issues
2
licenses
5
MIT
1
BSD-2-Clause
Package created
29 May 2015
Version published
10 Oct 2020
Maintainers
2
Total deps
6
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
ajv@6.12.6
fast-deep-equal@3.1.3
fast-json-stable-stringify@2.1.0
json-schema-traverse@0.4.1
punycode@2.3.1

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
uri-js@4.4.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of ajv 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
fast-deep-equal3.1.33.57 kBMIT
prod
fast-json-stable-stringify2.1.06.17 kBMIT
prod
json-schema-traverse0.4.15.02 kBMIT
prod
uri-js4.4.1128.91 kBBSD-2-Clause
prod

Visualizations

Frequently Asked Questions

What does ajv do?

Ajv, short for Another JSON Schema Validator, is a powerful JSON validator for Node.js and browsers. It is acknowledged as one of the fastest JSON validators as it converts JSON Schemas into super-fast validation functions optimized for v8 JavaScript engine. Ajv supports all validation keywords of JSON Schema draft-04/06/07/2019-09/2020-12, provides full support of remote references, ensures correct string lengths for unicode pairs, allows asynchronous loading of referenced schemas and many more advanced features. Notably, it also offers Ajv i18n package for internationalized error messages.

How do you use ajv?

To use Ajv, first ensure you have it installed in your project by running npm install ajv in your command line terminal. Once installed, import the Ajv module and create an instance of it. You can then use compile method to create a validation function from your JSON schema. After the validation function is generated, you can validate your data using this function. Example usage in JavaScript is as follows:

import Ajv from "ajv";

const ajv = new Ajv();

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);

In this example, a data object is tested against the defined schema. The valid constant returns true if data is valid against the schema or false otherwise. If data is invalid, the validation errors can be obtained from validate.errors.

Where are the ajv docs?

All documentation needed to utilize Ajv to its full potential can be found on the Ajv website. Useful links on the website include the "Getting started" guide, API reference, FAQ, and more advanced topics like security considerations, standalone validation code, strict mode, and JSON Schema vs JSON Type Definition comparison.