https://github.com/marcisbee/esjson
🛡 Fast JSON Schema validator (cli)
https://github.com/marcisbee/esjson
cli hacktoberfest json json-schema json-schema-validator schema validator
Last synced: about 1 month ago
JSON representation
🛡 Fast JSON Schema validator (cli)
- Host: GitHub
- URL: https://github.com/marcisbee/esjson
- Owner: Marcisbee
- License: mit
- Created: 2020-11-10T15:44:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T09:14:49.000Z (about 2 years ago)
- Last Synced: 2025-04-10T06:50:30.511Z (about 1 month ago)
- Topics: cli, hacktoberfest, json, json-schema, json-schema-validator, schema, validator
- Language: JavaScript
- Homepage:
- Size: 93.8 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esjson
JSON Schema validator (cli)[](https://www.npmjs.com/package/esjson)
[](https://www.npmjs.com/package/esjson)
[](https://bundlephobia.com/result?p=esjson)
[](https://discord.gg/a62gfaDW2e)## Command line interface
Install esjson with npm to use the command line interface:```bash
npm install esjson -g
```Validate a file like so:
```bash
esjson file.json --schema=schema.json
```## Options
```
Usage: esjson [file] [options]file file to parse; otherwise uses stdin
Options:
-v, --version print version and exit
-s, --schema validate json according to schema
-i, --include array of file paths to include (default: *.json)
-e, --exclude array of file paths to exclude (default: node_modules/**)
-a, --allow rules for definitions and keys to allow (example: additionalProperties:name:MyDefinition)
--empty array of file paths to allow to be empty
```# Motivation
Some of the already existing tools were not good enough for my use case (e.g. validating large list of definitions and returning quite specific errors was impossible with other json schema validators out there). So I just built my own. It does not fully comply with spec __yet__, but I'm planning to add features from spec as the time goes!
Also there is little to none documentation. If you really want to use this tool, then open an issue requesting detailed documentation, I'll see what I can put together.
# MIT License
Copyright (C) 2020 Marcis BergmanisPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.