cockrel-mog
v1.0.1
Published
Cockrel plugin for object filtering with mog
Downloads
7
Readme
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);
});