@malga/card-validator
v1.4.0
Published
A simple card validator
Downloads
579
Readme
A simple card validator based on the Braintree validator
Getting Started
- Install the
card-validator
💳
yarn add @malga/card-validator
# or
npm install @malga/card-validator
- 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!