You can use this tool to validate credit card numbers based on the Luhn algorithm.
Calling the validate function in main.js with a credit card number in a string will return true if the number is valid, false otherwise.
mendelsphotography/credit-card-checker
Simple-Credit-Card-Checker-Validator In js With Comments
JavaScript