README
chameleon-notation
Chameleon notation validator based on Ajv json schema validator
Build Setup
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run all tests
npm test
Using
Import
import chameleonNotation from 'chameleon-notation';
in Node.js
const chameleonNotation = require('chameleon-notation');
Perform validation
const validation = chameleonNotation.validate(data);
if (!validation.isValid) {
const errors = validation.errors;
console.log(validation.message);
}
or use some of predefined item validators
const pageValidation = chameleonNotation.validatePage(data);
const formValidation = chameleonNotation.validateForm(data);
const fieldValidation = chameleonNotation.validateField(data);
CLI Setup
Prerequisite - run build step
# make command available (symlink)
npm link
# list all commands and options
clint -h