Seneca plugin that provides parambulator message validation.
npm install seneca-parambulator> A [Seneca.js][] plugin that validates messages using the
> parambulator module.
This plugin is included by default in Seneca 2.x.
NOTE: This plugin will not be included by default in Seneca 3.x
and above, and will need to be installed manually.
Supports Seneca versions 1.x - 3.x
``sh`
npm install seneca-parambulator
And in your code:
`js`
require('seneca')()
.use('parambulator')
You can validate action messages by providing
parambulator rules as part of the
action definition.
`js``
require('seneca')
.use('parambulator') // not needed if Seneca 2.x
.add(
{
a: 1,
b: {required$: true}
},
function (msg, done) {
done(null, {c: msg.b})
})
.act('a:1,b:2') // valid
.act('a:1') // invalid as no b value
Any properties in the action pattern that are not constants are
interpreted as_ parambulator_ rules.
The [Senecajs org][] encourages open participation. If you feel you
can help in any way, be it with documentation, examples, extra
testing, or new features please get in touch.
[MIT]: ./LICENSE
[npm-badge]: https://badge.fury.io/js/seneca-parambulator.svg
[npm-url]: https://badge.fury.io/js/seneca-parambulator
[Senecajs org]: https://github.com/senecajs/
[Seneca.js]: https://www.npmjs.com/package/seneca
[@senecajs]: http://twitter.com/senecajs
[senecajs.org]: http://senecajs.org/
[travis-badge]: https://travis-ci.org/senecajs/seneca-parambulator.svg
[travis-url]: https://travis-ci.org/senecajs/seneca-parambulator
[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/senecajs/seneca
[github issue]: https://github.com/senecajs/seneca-parambulator/issues
[david-badge]: https://david-dm.org/rjrodger/seneca-parambulator.svg
[david-url]: https://david-dm.org/rjrodger/seneca-parambulator