Validation sugar with is
JavaScript
Switch branches/tags
Nothing to show
Latest commit 6989460 Mar 14, 2013 @mikefrey updated readme
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

prove

Validation sugar with is-it

Installation

npm install prove

Usage

var prove = require('prove')

if (var errs = prove(5).is('integer greaterThan(0)').errors) {
  // not valid
}

prove can also be chained:

prove('foo').is('string').isnt('integer').errors

API

prove(value)

Returns a chainable object with is, isnt and errors.

.is(conditions)

Runs the listed conditions against the value provided in prove.

.isnt(conditions)

Runs the conditions against the value provided in prove but negated.

.errors

This property contains an array of invalid conditions, or null.