Skip to content

jermainee/credit-card-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Generator

With this simple TypeScript tool you can generate valid credit card numbers with fake details for testing purposes

Node.js Package

Installation

npm install jermainee/credit-card-generator

Usage

Import the CreditCardGenerator and CreditCardVendor enum

import CreditCardGenerator, { CreditCardVendor } from 'credit-card-generator';

Generating a single credit card number:

const creditCardNumber = creditCardGenerator.generateSingle(CreditCardVendor.VISA);

Generating multiple credit card numbers:

const creditCardNumbers = creditCardGenerator.generateMultiple(CreditCardVendor.MasterCard, 3);

Generating a credit card number using your own preset (see ICreditCardPreset):

const creditCardNumber = creditCardGenerator.generateWithPreset(preset);

Supported credit card vendors

  • VISA
  • MasterCard
  • Amex
  • Diners
  • Discover
  • EnRoute
  • JCB
  • Voyager