0.1.0 • Published 13 years ago

satisfic v0.1.0

Weekly downloads
4
License
-
Repository
github
Last release
13 years ago

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.