# jsjsonschema

> Check/Validate JSON and existing references

Latest version **1.1.7** (published 2017-01-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install jsjsonschema
pnpm add jsjsonschema
yarn add jsjsonschema
bun add jsjsonschema
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2017-01-06 |
| First published | 2016-12-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brendon Willian |
| Maintainers | brenw |
| Keywords | JSON, schema, validator, validation, check, reference checker |

## Links

- npm: https://www.npmjs.com/package/jsjsonschema
- Repository: https://github.com/Brenw10/jsjsonschema
- Homepage: https://github.com/Brenw10/jsjsonschema#readme
- Issues: https://github.com/Brenw10/jsjsonschema/issues
- npm.io page: https://npm.io/package/jsjsonschema

## Dependencies (1)

- [jsonschema](https://npm.io/package/jsonschema.md) ^1.1.1

## 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

- 1.1.7 (latest) — 2017-01-06
- 1.1.6 — 2017-01-06
- 1.1.5 — 2017-01-06
- 1.1.4 — 2017-01-06
- 1.1.3 — 2017-01-05
- 1.1.2 — 2017-01-04
- 1.1.1 — 2017-01-03
- 1.1.0 — 2017-01-03
- 1.0.9 — 2017-01-03
- 1.0.8 — 2016-12-20
- 1.0.7 — 2016-12-20
- 1.0.6 — 2016-12-20
- 1.0.5 — 2016-12-20
- 1.0.4 — 2016-12-20
- 1.0.3 — 2016-12-20
- … 3 more at https://npm.io/package/jsjsonschema/versions

## README

# Javascript JSON Schema

> Do you want to contribute with this project? Contact me: bw.bwctm@gmail.com

##Code example:

```
    var jsonschema = require('jsjsonschema');
    
    var article = {
        "$ref$": "article_1",
        "title": "This is an Article",
        "page": "ref(page_1)",
        "other": {
            "something": "ref(article_1)"
        }
    };
    
    var page = {
        "$ref$": "page_1",
        "title": "This is a page"
    };
    
    var articleSchema = {
        "id": "/ArticleSchema",
        "type": "object",
        "properties": {
            "title": {
                "type": "integer"
            },
            "page": {
                "type": "integer",
                "$ref$": "($ref$)"
            },
            "other": {
                "properties": {
                    "something": {
                        "type": "string",
                        "$ref$": "($ref$)"
                    }
                }
            }
        }
    };
    
    var pageSchema = {
        "id": "/PageSchema",
        "type": "object",
        "properties": {
            "title": {
                "type": "string"
            }
        }
    };
    
    jsonschema.addSchema('/ArticleSchema', articleSchema);
    jsonschema.addSchema('/PageSchema', pageSchema);
    
    jsonschema.addValidate('/ArticleSchema', article, 'article');
    jsonschema.addValidate('/PageSchema', page, 'page');
    
    jsonschema.start();
    
    console.log(jsonschema.getErrors());
```

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