@malga/card-validator
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Card Validator

CI

A simple card validator based on the Braintree validator

Getting Started

  1. Install the card-validator 💳
yarn add @malga/card-validator
# or
npm install @malga/card-validator
  1. Now just validate your cards
import cardValidator from '@malga/card-validator'

cardValidator.number('6274160007029307')
/*
{
  card: {
    niceType: 'VR',
    type: 'vr',
    patterns: [ 627416, 637036 ],
    gaps: [],
    lengths: [ 16 ],
    code: { name: 'CVV', size: 3 },
    matchStrength: 6
  },
  isPotentiallyValid: true,
  isValid: true
}
*/

Contributing

Feel free to contribute to this project by submitting pull requests, creating documentation, or bringing ideas to make the project even better!

Readme

Keywords

none

Package Sidebar

Install

npm i @malga/card-validator

Weekly Downloads

197

Version

1.4.0

License

MIT

Unpacked Size

7.54 kB

Total Files

9

Last publish

Collaborators

  • malga.io