Package Exports
- ajv-async
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 (ajv-async) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ajv-async
Configure async validation mode in Ajv - JSON-Schema validator
Install
npm install ajv-asyncUsage
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/)