Socket
Book a DemoInstallSign in
Socket

@malga/card-validator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@malga/card-validator

A simple card validator

1.6.0
latest
npmnpm
Version published
Weekly downloads
246
55.7%
Maintainers
1
Weekly downloads
 
Created
Source

Card Validator

CI

A simple card validator based on the Braintree validator

Getting Started

  • Install the card-validator 💳
yarn add @malga/card-validator
# or
npm install @malga/card-validator
# or
pnpm add @malga/card-validator
  • Now just validate your cards
import { valid } from '@malga/card-validator'

valid.number('6274160007029307')
/*
{
  card: {
    niceType: 'VR',
    type: 'vr',
    patterns: [ 627416, 637036 ],
    gaps: [],
    lengths: [ 16 ],
    code: { name: 'CVV', size: 3 },
    matchStrength: 6
  },
  isPotentiallyValid: true,
  isValid: true
}
*/
  • Mask a card number
import { maskCardNumber } from '@malga/card-validator'

maskCardNumber('0000000000000000')
// 0000 0000 0000 0000

Contributing

Feel free to contribute to this project by submitting pull requests, creating documentation, or bringing ideas to make the project even better!

FAQs

Package last updated on 04 Aug 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.