1.0.3 • Published 8 years ago

fullccnum v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

10 years ago