🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

credit-cards

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

credit-cards

Validate & extract metadata from credit cards.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

node-credit-cards

Validate & extract metadata from credit cards.

=== Basic usage

var creditCards = require('credit-cards')

creditCards.isValid("4024 0071 2016 8322")
=> true
creditCards.isValid("4034 0071 2016 8322")
=> false

creditCards.getTypeCode("4034 0071 2016 8322")
=> 'VI'
creditCards.getTypeName("4034 0071 2016 8322")
=> 'Visa'

creditCards.getInfo('3478 7964 2068 802')
=> { valid: true, code: 'AX', name: 'American Express' }

=== Advanced usage

var creditCards = require('credit-cards')

var scoped = creditCards({ accepted: ['VI', 'AX'] })

scoped.isValid("4024 0071 2016 8322")
=> true
scoped.getTypeCode("4034 0071 2016 8322")
=> 'VI'
scoped.isAccepted('5290 6473 7075 0487')
=> false
scoped.getInfo('5290 6473 7075 0487')
=> { valid: true, code: 'CA', name: 'Master Card', accepted: false }

Keywords

credit

FAQs

Package last updated on 30 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts