# jsonschema-is-js

> The jsonschema validator property included is.js functions

Latest version **0.3.0** (published 2016-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsonschema-is-js
pnpm add jsonschema-is-js
yarn add jsonschema-is-js
bun add jsonschema-is-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-03-29 |
| First published | 2015-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jhen |
| Maintainers | jhen0409 |
| Keywords | jsonschema, is.js |

## Links

- npm: https://www.npmjs.com/package/jsonschema-is-js
- Repository: https://github.com/jhen0409/jsonschema-is-js
- Homepage: https://github.com/jhen0409/jsonschema-is-js#readme
- Issues: https://github.com/jhen0409/jsonschema-is-js/issues
- npm.io page: https://npm.io/package/jsonschema-is-js

## Dependencies (1)

- [is_js](https://npm.io/package/is_js.md) ^0.7.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.0 (latest) — 2016-03-29
- 0.2.0 — 2015-09-03
- 0.1.1 — 2015-09-02
- 0.1.0 — 2015-09-02
- 0.0.1 — 2015-09-02

## README

# jsonschema-is-js [![Build Status](https://travis-ci.org/jhen0409/jsonschema-is-js-plugin.svg)](https://travis-ci.org/jhen0409/jsonschema-is-js-plugin) [![NPM version](http://img.shields.io/npm/v/jsonschema-is-js.svg?style=flat)](https://www.npmjs.com/package/jsonschema-is-js)

The [jsonschema](https://github.com/tdegrunt/jsonschema) validator property included [is.js](https://github.com/arasatasaygin/is.js) functions for JavaScript.

## Install

```
npm i --save jsonschema-is-js
```

## Usage

```js
var Validator = require('jsonschema').Validator;
var isPlugin = require('jsonschema-is-js');
var v = new Validator();

v.attributes.is = isPlugin();

var schema = {
  type: 'object',
  properties: {
    emails: { type: 'array', is: 'all.email' },  // <- use attribute
    text: { type: 'string', is: 'include:some' } // <- method:value, result: is.include(text, 'some')
  }
};

var result1 = v.validate({
  emails: [ 'a@test.cc', 'b@test.cc', 123, 'test' ]
}, schema);
var result2 = v.validate({
  emails: [ 'a@test.cc', 'b@test.cc', 'test@ggg.gg' ],
  text: 'some text...'
}, schema);

console.log(result1.errors);  // error
console.log(result2.errors);  // not error
```

Or use is.js of override regex:
```js
var is = require('is_js')
is.setRegexp(/quack/, 'url');
v.attributes.is = isPlugin(is);
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/jsonschema-is-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
