joi-creditcard-extension

1.0.3 • Public • Published

joi-creditcard-extension

Joi extension for credit card validation

CircleCI npm version Known Vulnerabilities

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    3
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i joi-creditcard-extension

Weekly Downloads

3

Version

1.0.3

License

MIT

Last publish

Collaborators

  • paflopes