cranq-schema-validator
v0.1.2
Published
Schema Validator for Cranq ==========================
Downloads
2
Readme
Schema Validator for Cranq
Validates a JSON file against the Cranq Schema
Usage
Node
yarn add cranq-schema-validator
OR npm install cranq-schema-validator
const cranqSchemaValidator = require('cranq-schema-validator');
const fs = require('fs');
const jsonFileToTest = '<FILENAME>';
const testJSON = JSON.parse(fs.readFileSync(`${jsonFileToTest}`).toString())
cranqSchemaValidator.validate(testJSON)
.then(() => {
console.log('Great success!');
}).catch((err) => {
console.log(err.errors);
});
Contributing
yarn install
yarn test