Query Credit Card Validator is written in CoffeeScript and (surprise, surprise!) is a jQuery plugin. It analyses the card number in the input field on which it was called, and returns an object with four properties:
card_type — an object with the below properties, or null if card type unknown
name — one of the strings describing the card type, eg visa
pattern — regular expression used to match the card type, eg /^4/
length — a list of valid lengths for the card type, eg [13, 16]
valid — true if the number is valid, false otherwise
length_valid — true if the number length is valid, false otherwise
luhn_valid — true if the Luhn checksum is correct, false otherwise