Neanderthal Painting Monet

    validator-bank-card

    1.0.0 • Public • Published

    Simple bank card validator

    This Package is based on luhn algorithm where it return data like this:

    {
      "chipset": "MASTERCARD",
      "card_number": "5425233430109903",
      "is_valid": true
    }
    {
      "chipset": "VISA",
      "card_number": "4554738890994555",
      "is_valid": false
    }

    Installation

    npm install validator-bank-card --save

    Usage

    The javascript discipline used in this package is ES6 where the package.json is set to "type": "module"

    import validator from "validator-bank-card";
    
    let valid_card = new validator("5425233430109903").validate();
    let invalid_card = new validator("4554738890994555").validate();
    
    console.log(valid_card);
    /**
     * output:
     *
     * {
     *   "chipset": "MASTERCARD",
     *   "card_number": "5425233430109903",
     *   "is_valid": true
     * }
     */
    
    console.log(invalid_card);
    /**
     * output:
     *
     * {
     *   "chipset": "VISA",
     *   "card_number": "4554738890994555",
     *   "is_valid": false
     * }
     */

    Install

    npm i validator-bank-card

    DownloadsWeekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.13 kB

    Total Files

    5

    Last publish

    Collaborators

    • johnmelodymel