Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A data validator by specification.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
package.json
readme.md

readme.md

A data validator by specification.

Install

$ npm install satisfic

Examples

var Satisfic = require('satisfic');

var spec = Satisfic.spec({
    name: function (checker, data, process) {
        checker.notEmpty();
    },
    email: function (checker, data, process) {
        checker.notEmpty().isEmail();
    }
});

spec.isSatisfied({ name: 'kumatch', email: 'kumatch@example.com' }, function (err, results) {
    console.log(results.name);
    console.log(results.email);
});

Checker (for validation object) in spec is node-validator, see detail.

Something went wrong with that request. Please try again.