Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iin-checker

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iin-checker - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

CONTRIBUTING.md

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# Changelog
## **0.1.4**
- Documentation all updated. Now shows clear use cases and examples.
## **0.1.3**

@@ -2,0 +7,0 @@ - [**#3**](https://github.com/Shortbreaks/iinChecker/issues/3) Testing multiple, stubbed out providers

2

package.json
{
"name": "iin-checker",
"description": "Issuer identification number checker which returns details about a credit/debit card",
"version": "0.1.3",
"version": "0.1.4",
"homepage": "https://github.com/Shortbreaks/iinChecker",

@@ -6,0 +6,0 @@ "author": "Simon Wood <simon.wood@holidayextras.com> (https://github.com/Shortbreaks)",

@@ -20,33 +20,72 @@ # IIN Checker for payment cards

## Getting Started
## Installation
If you want to work on this repo you will need to install the dependencies
The module is available in the NPM registery. It can be installed using the
`npm` commandline utlity.
```
$ npm install
npm install iin-checker
```
#### EditorConfig
Once you have installed the module you can simply require inside of your Node.js
application and use it's exported methods. Here is a simple example of that which gets the card details back as an object:
EditorConfig helps us define and maintain consistent coding styles between different editors and IDEs. If you are using Sublime Editor you can install the `EditorConfig` using [Package Control](https://sublime.wbond.net).
```js
var IinChecker = require( 'iin-checker' );
var iin = new IinChecker( {} );
For non Sublime development a bunch of other IDE plugins are available [here](http://editorconfig.org/#download)
iin.lookup( '543210', function( err, result ) {
if ( err ) {
console.log( 'Error:', err );
} else {
console.log( 'Result:', result );
}
} );
```
## Documentation
### Card Type Detection
Visit our [GitHub](https://github.com/Shortbreaks) website for all the things.
If you want to test to see if the card is a Credit or Debit card you can can achive this in the following way:
## Notes on coding style
```js
var IinChecker = require( 'iin-checker' );
var iin = new IinChecker( {} );
Code is linted by ".jshintrc" and checked against the coding style guide "shortbreaks.jscs.json" when you run the default grunt task:
iin.lookup( '543210', function( err, result ) {
if ( err ) {
console.log( 'Error:', err );
} else {
var isDebit = ( result.type === iin.types.DEBIT )
console.log( 'Debit?:', isDebit );
}
} );
```
$ grunt
```
## Tests
Possible values for _iin.types_ are **DEBIT**, **CREDIT** and **UNKNOWN**.
Tests will run using the default grunt task but can also be called stand-alone using:
### Card Brand Detection
If you want to test to see which brand the card is, you can can achive this in the following way:
```js
var IinChecker = require( 'iin-checker' );
var iin = new IinChecker( {} );
iin.lookup( '543210', function( err, result ) {
if ( err ) {
console.log( 'Error:', err );
} else {
var isMastercard = ( result.brand === iin.brands.MASTERCARD )
console.log( 'Mastercard?:', isMastercard );
}
} );
```
$ grunt test
```
Possible values for _iin.brands_ are **VISA**, **MASTERCARD**, **AMEX**, **DISCOVER**, **JCB**, **MAESTRO** and **LASER**. In future more card brands will be supported, if you need a brand adding please raise an issue.
## [Changelog](CHANGELOG.md)
## [Contributing](CONTRIBUTING.md)
## License

@@ -56,8 +95,7 @@ Copyright (c) 2014 Shortbreaks

## Todo (REMOVE BEFORE FINAL COMMIT)
- Get mock working with ribon provider
## Todo
- Get non-provider RegEx alternative
- Read providers from configs (as the tests do)
- Allow preference of providers to be passed into options
- Support caching
- Write excellent docs
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc