Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/stardust-configs/json-schema-validator
- Owner: stardust-configs
- Archived: true
- Created: 2021-01-24T06:25:48.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-01T04:54:03.000Z (over 2 years ago)
- Last Synced: 2024-09-21T08:03:09.927Z (3 months ago)
- Topics: json-schema, json-schema-validator
- Language: TypeScript
- Homepage:
- Size: 677 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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