New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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 - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

index.js

14

package.json
{
"name": "ajv-async",
"version": "0.0.1",
"description": "Managing and detecting async validation mode in Ajv - JSON-Schema validator",
"version": "0.1.0",
"description": "Configure async validation mode in Ajv - JSON-Schema validator",
"main": "index.js",

@@ -23,3 +23,7 @@ "scripts": {

"async",
"asynchronous",
"asynchronous validation",
"ajv",
"generators",
"async-function",
"co",

@@ -34,3 +38,7 @@ "nodent",

},
"homepage": "https://github.com/epoberezkin/ajv-async#readme"
"homepage": "https://github.com/epoberezkin/ajv-async#readme",
"devDependencies": {
"nodent": "^3.0.7",
"regenerator": "^0.9.5"
}
}
# ajv-async
Managing and detecting async validation mode in Ajv - JSON-Schema validator
Configure async validation mode in [Ajv](https://github.com/epoberezkin/ajv) - JSON-Schema validator
[![npm version](https://badge.fury.io/js/ajv-async.svg)](https://www.npmjs.com/package/ajv-async)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
## Install
```shell
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](https://github.com/MatAtBread/nodent) or [regenerator](https://github.com/facebook/regenerator), ajv-async doesn't install them.
```javascript
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](https://github.com/epoberezkin/ajv#asynchronous-validation) 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](https://webpack.github.io/docs/list-of-plugins.html#ignoreplugin):
```javascript
new IgnorePlugin(/regenerator|nodent/, /ajv-async/)
```
## License
[MIT](https://github.com/epoberezkin/ajv-async/blob/master/LICENSE)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc