Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.01 KB

QUICKSTART.md

File metadata and controls

54 lines (35 loc) · 1.01 KB

How to get going in a minute

Download via npm/bower/yarn

npm install fluent-schemer

bower install fluent-schemer

yarn add fluent-schemer

Set it up in your code

Node.js

  • 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));

Browser

<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));

ES2015 (Harmony) modules

import { number, string, bool, object, array } from 'fluent-schemer';

const ageSchema = number().min(0).integer().required();

console.log(ageSchema.validate(-1.5));

Start declaring and validating - docs & examples