prove

Simple validation with is

prove

Validation sugar with is-it

npm install prove
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

Returns a chainable object with is, isnt and errors.

Runs the listed conditions against the value provided in prove.

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

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