@kanaqsasak/card-gen
v1.0.0
Published
CLI tool to generate Luhn-valid test payment card numbers for Visa, Mastercard, Amex, Discover, UnionPay, JCB, Diners Club, Maestro, Mir, RuPay and more
Maintainers
Readme
card-gen
Generate Luhn-valid test payment card numbers from the command line.
Install
npm install -g card-genUsage
card-gen [options]
Options:
-n, --count <number> Number of cards to generate (default: 5)
-t, --type <network> Card network (default: "all")
-b, --bin <prefix> Custom BIN prefix (overrides --type)
--cvv Include CVV/CVC in output
--expiry-from <MM/YY> Earliest expiry date (default: current month)
--expiry-to <MM/YY> Latest expiry date (default: 3 years from now)
-h, --help Display help
-V, --version Output version numberExamples
# 5 random cards across all networks
card-gen
# 10 Visa cards with CVV
card-gen -n 10 -t visa --cvv
# 3 cards with a custom BIN prefix
card-gen -n 3 -b 453985
# Mastercard cards expiring between 01/25 and 12/27
card-gen -n 8 -t mastercard --expiry-from 01/25 --expiry-to 12/27
# JCB cards with CVV
card-gen -n 4 -t jcb --cvvSupported networks
| ID | Network |
|---|---|
| visa | Visa |
| mastercard | Mastercard |
| amex | Amex |
| discover | Discover |
| unionpay | UnionPay |
| jcb | JCB |
| diners | Diners Club |
| maestro | Maestro |
| mir | Mir |
| rupay | RuPay |
| eftpos | eftpos |
Notes
- All card numbers pass the Luhn algorithm — they are structurally valid but not real cards.
- Card numbers are displayed without spaces for easy double-click selection and copying.
- Amex CVV is 4 digits; all others are 3 digits.
- UnionPay and Maestro cards can be 12–19 digits depending on the spec.
License
MIT
