luhn-cc
v0.0.6
Published
JavaScript library to validate credit card numbers using luhn algorithm
Downloads
9
Readme
💳✅❌ luhn-cc
JavaScript library to validate credit card numbers using luhn algorithm
Installation
$ npm i -S luhn-cc
Usage
import luhnCC from 'luhn-cc';
luhnCC.isValid('378282246310005'); // true
luhnCC.isValid('378282246'); // false
Tested Cards
| Credit Card Type | Credit Card Number | Tested | |----------------------|--------------------|--------| | AMEX | 378282246310005 | ✅ | | AMEX Corporate | 378734493671000 | ✅ | | Australian Bank Card | 5610591081018250 | ✅ | | Diners Club | 30569309025904 | ✅ | | Discover | 6011111111111117 | ✅ | | JCB | 3530111333300000 | ✅ | | Master Card | 5555555555554444 | ✅ | | VISA | 4111111111111111 | ✅ | | Switch/Solo | 6331101999990016 | ✅ |
Development Setup
# install dependencies
$ npm install
# dev mode
$ npm run dev
# test
$ npm run test
# build
$ npm run build