Skip to content

clayrisser/easy-joi

Repository files navigation

easy-joi

Beerpay Beerpay GitHub stars

Easy helper functions for joi

Please ★ this repo if you found it useful ★ ★ ★

Features

  • Promise based validation
  • Boolean validation

Installation

npm install --save easy-joi

Dependencies

Usage

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

Support

Submit an issue

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Beerpay (actually, I drink coffee)

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!

Beerpay Beerpay

About

Easy helper functions for joi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published