1.0.1 • Published 8 years ago
cockrel-mog v1.0.1
cockrel-mog
Cockrel plugin for filtering objects with mog
Install
Require cockrel and pass it's PluginManger to cockrel-mog to load the plugin:
const co = require('cockrel');
require('cockrel-mog')(co); // Good to go!
Usage
Cockrel-mog adds the .mog step which takes a multi-line mog schema see mog documentation
co.mog(`
user.name @String
user.pass @string { min : 8 } -- must be less than 8 chars`)
.do((data) => {
console.log('woohoo, validated results!', data.name, data.pass);
});