What problem does it solve?
Maintains the @ekaone/mask-card TypeScript library for masking PAN/credit card numbers to protect sensitive information in displays and logs, aligning with PCI display guidance (first 6 + last 4) and supporting docs, examples, tests, and builds.
Core Features & Use Cases
- Masking and formatting with maskCard, maskCardAuto, and maskCardBatch for display-safe PAN handling.
- Card-type detection (detectCardType) and grouping (getCardTypeGrouping) to drive formatting logic.
- Luhn validation (isValidCardLuhn, isValidCard) and helper utilities (getCardLast, getCardFirst, getCardLast4, getCardFirst6).
- Workflows for development, testing (Vitest), documentation, and npm publishing workflows.
- Security-focused defaults (last-4 visible by default) and configurable masking behavior.
Quick Start
Install the library and call maskCard with a card number to see a masked result.