You can tell to use any A compatible promise implemention like this: There are already many validation libraries out there today but most of them are very tightly coupled to a language or framework.
The goal of is to provide a cross framework and cross language way of validating data.
Besides accepting all options as the non async validation function it also accepts two additional options; clean Attributes which, unless before resolving the promise and wrap Errors which can be a function or constructor that will be called with the errors, options, attributes and constraints if an error occurs.
This allows you to define a better way of catching validation errors.
The message can also be a function which will be called to retrieve the message, besides this it is treated like a normal message (the attribute name is prepended etc).
If the message is not a function and not a string it is simply returned as is.
Unless otherwise specified you can always specify the message option to customize the message returned if the validator doesn't pass.
Just remember to not include the attribute name since it's automatically prepended to the error message.
If you want to modify which values are considered empty for example you can simply overwrite You can find some basic examples included in the project.The project can be found on Git Hub where you can also find our issue tracker.There is also a Travis project used for testing, a Coveralls project used to code coverage as well as the annotated source.The validation constraints can be declared in JSON and shared between clients and the server. One thing that is a bit unorthodox is that most validators will consider undefined values (,) valid values.So for example adding a constraint of at least 6 characters will be like saying If the attribute is given it must be at least 6 characters.