🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ajv-async

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajv-async

Configure async validation mode in Ajv - JSON-Schema validator

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4K
2.68%
Maintainers
1
Weekly downloads
 
Created
Source

ajv-async

Configure async validation mode in Ajv - JSON-Schema validator

npm version Gitter

Install

npm install ajv-async

Usage

The code below configures async mode in Ajv instance to use the best async mode (async functions or generators) available in the current environment with/without transpilation. If transpilation is required, you should install nodent or regenerator, ajv-async doesn't install them.

var Ajv = require('ajv');
var setupAsync = require('ajv-async');

var ajv = setupAsync(new Ajv);

async and/or transpile options can be passed to Ajv to enable a specific async/transpilation mode. See Ajv docs for more information.

Using in browser

At the moment Ajv already includes nodent and regenerators bundles. You still need to use this package, unless you manually set async option and explicitely pass processCode option. transpile option support requires using this package.

If you build this package with your code with Webpack, it will log warnings because this package uses optional dependencies. To suppress these warnings use IgnorePlugin:

new IgnorePlugin(/regenerator|nodent/, /ajv-async/)

License

MIT

Keywords

JSON

FAQs

Package last updated on 07 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts