Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stardust-configs/json-schema-validator

JSON Schema validator
https://github.com/stardust-configs/json-schema-validator

json-schema json-schema-validator

Last synced: 3 months ago
JSON representation

JSON Schema validator

Awesome Lists containing this project

README

        

# @stardust-configs/json-schema-validator

> JSON Schema validator

- Support for using CLI and module
- Support for multiple sources
- Support for Glob Pattern sources
- Support for local and remote JSON Schema

## Install

```bash
$ npm install @stardust-configs/json-schema-validator --save-dev
```

## Usage

```ts
import jsv from '@stardust-configs/json-schema-validator'

// Truthy
await jsv({
src: 'tsconfig.json',
schema: 'https://json.schemastore.org/tsconfig',
})

// Falsy
await jsv({
src: 'tsconfig.json',
schema: 'https://json.schemastore.org/typoconfig',
})
```

In CLI.

```bash
# basic
$ jsv "tsconfig.json" --schema "https://json.schemastore.org/tsconfig"

# glob
$ jsv "tsconfig.*.json" --schema "https://json.schemastore.org/tsconfig"

# multiple
$ jsv "tsconfig.node.json" "tsconfig.jest.json" --schema "https://json.schemastore.org/tsconfig"

# strict
$ jsv "tsconfig.json" --schema "https://json.schemastore.org/tsconfig" --strict
```

## Author

[@p-chan](https://github.com/p-chan)

## License

MIT