fullccnum

1.0.3 • Public • Published

Fullccnum

Use the Luhn algorithm to validate whether a number is a valid credit card number. Also includes helpers to scrub spaces, dashes, and the like.

Usage

	var Fullccnum = require('./lib/fullccnum');
	var ccNumInput = '4111-1111-1111-1111';
	var cleanCcNum = Fullccnum.scrubNonDigits(ccNumInput);
	if (Fullccnum.isValid(cleanCcNum)) {
		logger.debug('This is a valid credit card!');
	} else {
		logger.debug('This is not a valid credit card.');
	}

Run the tests

	npm test

npm listing

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    7
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    7
  • 1.0.2
    2
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i fullccnum

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • arkadyan