@stardust-configs/json-schema-validator
v0.4.0
Published
JSON Schema validator
Downloads
10
Maintainers
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
$ npm install @stardust-configs/json-schema-validator --save-dev
Usage
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.
# 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
License
MIT