credit-card-get-brand
v1.0.7
Published
![Downloads](https://img.shields.io/npm/dt/credit-card-get-brand.svg) [![PayPal][badge_paypal_donate]][paypal-donations]
Downloads
69
Maintainers
Readme
credit-card-get-brand
:cloud: Installation
# Using npm
npm install --save credit-card-get-brand
# Using yarn
yarn add credit-card-get-brand
:clipboard: 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'
}
*/
:mag: 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