validate-this-card

Checks and informs if a credit card number is valid.

Usage no npm install needed!

<script type="module">
  import validateThisCard from 'https://cdn.skypack.dev/validate-this-card';
</script>

README

Validate This Card v2.0.0

This library checks and informs if a credit card number is valid.

Following Luhn algorithm, it returns true if the credit card number entered is valid and false if it's not.

Installation

After installing npm on the computer (more info about it here), enter the following code in the terminal:

$npm install validate-this-card

Usage example

In Node.js, enter:

const lib = require('validate-this-card')
lib.cardValidator(36490102462661);
//true

Roadmap

Version 3.0.0 (tba)

  • Upon credit card brand detection, accepts a number only if it has the standard digit size set by each brand;
  • Accepts more than one argument (credit card number) at a time.

Version 2.0.0 (published)

  • Error's messages and README translated into English.

Version 1.0.0 (published)

  • Returns true if the credit card number entered is valid and false if it's not.

Project on Github

Validate This Card