joi-creditcard-extension
v1.0.3
Published
Validate credit cards with Joi
Downloads
6
Readme
joi-creditcard-extension
Joi extension for credit card validation
Lead Maintainer: Phillipe Lopes
Usage
Usage is a two steps process. First, a schema is constructed using the provided types and constraints:
const BaseJoi = require('joi');
const Extension = require('joi-creditcard-extension');
const Joi = BaseJoi.extend(Extension);
const schema = Joi.creditcard().number();
Joi.validate('5217 8503 2851 5461', Joi.creditcard().number()) // Output 5217850328515461
API
Take a look at the tests