validator-bank-card
v1.0.0
Published
A Simple Bank Card Validator
Downloads
2
Maintainers
Readme
Simple bank card validator
This Package is based on luhn algorithm where it return data like this:
{
"chipset": "MASTERCARD",
"card_number": "5425233430109903",
"is_valid": true
}
{
"chipset": "VISA",
"card_number": "4554738890994555",
"is_valid": false
}
Installation
npm install validator-bank-card --save
Usage
The javascript discipline used in this package is ES6
where the package.json is set to "type": "module"
import validator from "validator-bank-card";
let valid_card = new validator("5425233430109903").validate();
let invalid_card = new validator("4554738890994555").validate();
console.log(valid_card);
/**
* output:
*
* {
* "chipset": "MASTERCARD",
* "card_number": "5425233430109903",
* "is_valid": true
* }
*/
console.log(invalid_card);
/**
* output:
*
* {
* "chipset": "VISA",
* "card_number": "4554738890994555",
* "is_valid": false
* }
*/