1.0.1 • Published 8 years ago

cockrel-mog v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

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);
  });
1.0.1

8 years ago

1.0.0

8 years ago