Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

credit-card-validation-qp

mohammad-dc7ISC1.0.0

Verify the correctness of the entered card number and the type of card used

credit, card, validation, credit-card, credit-card-validation

readme

Credit Card Validation

Verify the correctness of the entered card number and the type of card used

Installation

npm i credit-card-validation --save

Then...

import { cardNumberValidation, getCardType } from 'credit-card-validation';

cardNumberValidation(CARD_NUMBER);  // false or true
getCardType(CARD_NUMBER);   //Mastercard, AMEX, Discover, Diners, Diners-Carte Blanche, JCB, Visa Electron or nothing