jso-cli

Generate JSON schema to an output file

Usage no npm install needed!

<script type="module">
  import jsoCli from 'https://cdn.skypack.dev/jso-cli';
</script>

README

jso-cli

Contents

  • Installation
  • Commands
    • [Generate JSON Schema]
  • [jso-cli options]

Installation

npm install -g jso-cli

Generate JSON Schema

This command generates JSON schema files from any valid JSON File

jso-cli -d ./valid.input.json -o ./output.schema.json

Parameters

-d - JSON data
-o - Output file name of generated JSON Schema

You can then validate data with the schema using ajv-cli

ajv-cli validate -d ./valid.input.json -s ./output.schema.json
ajv-cli validate -d ./test.input.json -s ./output.schema.json