Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc