This library checks and informs if a credit card number is valid.
Following Luhn algorithm, it returns true
if the credit card number entered is valid and false
if it's not.
After installing npm on the computer (more info about it here), enter the following code in the terminal:
$npm install validate-this-card
In Node.js, enter:
const lib = require('validate-this-card')
lib.cardValidator(36490102462661);
//true
- Upon credit card brand detection, accepts a number only if it has the standard digit size set by each brand;
- Accepts more than one argument (credit card number) at a time.
- Error's messages and README translated into English.
- Returns
true
if the credit card number entered is valid andfalse
if it's not.