@stardust-configs/json-schema-validator

JSON Schema validator

Usage no npm install needed!

<script type="module">
  import stardustConfigsJsonSchemaValidator from 'https://cdn.skypack.dev/@stardust-configs/json-schema-validator';
</script>

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

@p-chan

License

MIT