The main benefit of vouch is the ability to easily create custom error messages. The included dict.json file will give you the basic idea of how this works in principle, but let's use the following as an example:

var vouch =require('vouch');

vouch({

input: input,

schema: schema,

dict:{

'maximum':'Yo! \"__instance__\" is way larger than __detail__!'

}

},function(err){

if(err)returnconsole.log(err);// Human friendly errors!

// Yay! No errors.

});

In this instance, an error of type maximum will result in a custom error. The __instance__ and __detail__ variables can be used to inject detail into the resulting error message.