1.4.0 • Published 6 years ago

s-creditcard v1.4.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

s-creditcard

NPM version Dependencies build status NPM license

Installation

npm install --save s-creditcard

Usage

Input a credit card number (as a string) and it returns the type of credit card. Incomplete inputs will also return successfully for the following card types:

  • visa
  • amex
  • mastercard
  • discover
  • jcb
card('4242424242424242') // returns 'visa'
Supported card types
  • Visa (visa)
  • Mastercard (mastercard)
  • Discover (discover)
  • American Express (amex)
  • Diners Club (dinersClub)
  • JCB (jcb)
  • Carte Blanche (carteBlanche)
  • Unionpay (unionpay)
  • Lasercard (lasercard)
  • Solo (solo)
  • Maestro (maestro)

All other valid credit cards return other. Invalid credit cards return none. Be sure to trim whitespace and remove non-numeric characters from the credit card number.

1.4.0

6 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.0

9 years ago