Skip to content

Commit 1671eb6

Browse files
committed
Fix readme
1 parent 7d8ce53 commit 1671eb6

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
node-credit-cards
22
=================
33

4-
Validate, & exrtact info from credit cards.
4+
Validate & extract metadata from credit cards.
55

6+
=== Basic usage
7+
8+
```js
9+
var creditCards = require('credit-cards')
10+
11+
creditCards.isValid("4024 0071 2016 8322")
12+
=> true
13+
creditCards.isValid("4034 0071 2016 8322")
14+
=> false
15+
16+
creditCards.getTypeCode("4034 0071 2016 8322")
17+
=> 'VI'
18+
creditCards.getTypeName("4034 0071 2016 8322")
19+
=> 'Visa'
20+
21+
creditCards.getInfo('3478 7964 2068 802')
22+
=> { valid: true, code: 'AX', name: 'American Express' }
23+
```
24+
25+
=== Advanced usage
26+
var creditCards = require('credit-cards')
27+
28+
var scoped = creditCards({ accepted: ['VI', 'AX'] })
29+
30+
scoped.isValid("4024 0071 2016 8322")
31+
=> true
32+
scoped.getTypeCode("4034 0071 2016 8322")
33+
=> 'VI'
34+
scoped.isAccepted('5290 6473 7075 0487')
35+
=> false
36+
scoped.getInfo('5290 6473 7075 0487')
37+
=> { valid: true, code: 'CA', name: 'Master Card', accepted: false }

package.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
{
22
"name" : "credit-cards",
3-
"version" : "0.5.0",
3+
"description": "Validate & extract metadata from credit cards.",
4+
"version" : "0.5.2",
45
"main" : "lib/index.js",
56
"scripts" : {
67
"test" : "mocha test/lib/"
78
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/dxg/node-credit-cards.git"
12+
},
13+
"keywords": [
14+
"credit", "card", "creditcards", "validate"
15+
],
16+
"author" : "Arek W <[email protected]>",
17+
"license" : "MIT",
818
"dependencies": {
9-
"luhn" : "1.0.5"
19+
"luhn" : "1.0.5"
1020
},
1121
"devDependencies": {
1222
"mocha" : "1.12.1",
1323
"should" : "1.2.2"
24+
},
25+
"bugs": {
26+
"url" : "https://github.com/dxg/node-credit-cards/issues"
1427
}
1528
}

0 commit comments

Comments
 (0)