Easy helper functions for joi
Please ★ this repo if you found it useful ★ ★ ★
- Promise based validation
- Boolean validation
npm install --save easy-joi
import validate, { isValid } from 'easy-joi';
async function() {
console.log(await isValid('email@example.com', joi.string().email())); // true
console.log(await isValid('i am not an email', joi.string().email())); // false
console.log(await validate('email@example.com', joi.string().email(), 'email')); // email@example.com
console.log(await validate('i am not an email', joi.string().email(), 'email')); // throws error
}();
Submit an issue
Review the guidelines for contributing
Jam Risser © 2018
Review the changelog
- Jam Risser - Author
A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.
Add some fuel if you'd like to keep me going!