anrim-validator

Validator

Validator

JSON schema validator for node.js and the browser.

Node.js

$ npm install anrim-validator

Component

$ component install anrim/validator
  • Validate obj with JSON schema
  • Check value with chaining
  • Works client & server-side

validate(obj, schema, options)

check(value)

  • default - default value or function
  • required - value can't be empty
  • type - array, boolean, string, number, date or object
  • enum - value must be in array
  • items - schema(s) of values in the array

TBA

  • Add lots of more validators
  • Pass tests for JSON schema draft 4

MIT