npm install fluent-schemer
bower install fluent-schemer
yarn add fluent-schemer
- ES2015
import { number } from 'fluent-schemer';
const ageSchema = number().min(0).integer().required();
console.log(ageSchema.validate(-1.5));
- ES5
const { string } = require('fluent-schemer');
var ageSchema = number().min(0).integer().required();
console.log(ageSchema.validate(-1.5));
<script src="path_to_modules/fluent-schemer/dist/index.es5.min.js"></script>
const { number } = window.FluentSchemer;
const ageSchema = number().min(0).integer().required();
console.log(ageSchema.validate(-1.5));
import { number, string, bool, object, array } from 'fluent-schemer';
const ageSchema = number().min(0).integer().required();
console.log(ageSchema.validate(-1.5));