credit-card-get-brand
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

credit-card-get-brand

Downloads PayPal

☁️ Installation

# Using npm
npm install --save credit-card-get-brand

# Using yarn
yarn add credit-card-get-brand

📋 Example

From the card number, return the brand

var creditCard = require("credit-card-get-brand");

const cardNumber = "4111111111111111"; // Visa
const brand = creditCard.getBrand(cardNumber);

console.log(brand);

/* Output:

    {
        code: 'visa',
        name: 'Visa',
        image: 'https://i.im.ge/2022/08/06/FcJsAy.visa.png'
    }
*/

🔍 API

getBrand(cardNumber: String)

getBrand will return an objects with the following data:

Key Type Description
name String Brand name
code String Brand unique identification
image String Brand image link

Accepted brands

  • ELO
  • MASTERCARD
  • MAESTRO
  • AMEX
  • DISCOVER
  • DINERS
  • JCB
  • HIPERCARD
  • VISA

Package Sidebar

Install

npm i credit-card-get-brand

Weekly Downloads

2

Version

1.0.7

License

MIT

Unpacked Size

7.61 kB

Total Files

9

Last publish

Collaborators

  • aguiaru11