The concept of Leason is simple: learn the schema by feeding json documents.
Install:
npm i leason -g
CLI:
$ bin/leason Usage: leason [options] Options: -h, --help output usage information -V, --version output the version number -t, --title add titles -f, --format try to detect format -e, --enum try to detect enum -s, --similar <n> merge similar objects if `n` or more properties are the same -d, --default add defaults -r, --required add required Examples: $ leason my.json $ cat my.json | leason > schema.json
Script:
var Leason = require('leason');var json = require('./package.json');var leason = new Leason()leason.parse(json);console.log(leason.schema);