Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhermsmeier/node-creditor-id
Parse, format and validate a Creditor Identifier (CID)
https://github.com/jhermsmeier/node-creditor-id
creditor-identifier finance fintech
Last synced: about 2 months ago
JSON representation
Parse, format and validate a Creditor Identifier (CID)
- Host: GitHub
- URL: https://github.com/jhermsmeier/node-creditor-id
- Owner: jhermsmeier
- License: mit
- Created: 2016-04-22T21:14:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T12:31:11.000Z (over 7 years ago)
- Last Synced: 2024-10-23T22:52:58.840Z (about 2 months ago)
- Topics: creditor-identifier, finance, fintech
- Language: JavaScript
- Size: 12.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Creditor Identifier
[![npm](https://img.shields.io/npm/v/creditor-id.svg?style=flat-square)](https://npmjs.com/creditor-id)
[![npm license](https://img.shields.io/npm/l/creditor-id.svg?style=flat-square)](https://npmjs.com/creditor-id)
[![npm downloads](https://img.shields.io/npm/dm/creditor-id.svg?style=flat-square)](https://npmjs.com/creditor-id)
[![build status](https://img.shields.io/travis/jhermsmeier/node-creditor-id.svg?style=flat-square)](https://travis-ci.org/jhermsmeier/node-creditor-id)## Install via [npm](https://npmjs.com)
```sh
$ npm install creditor-id
```## Usage
```js
var CreditorId = require( 'creditor-id' )
```**Parsing CIDs**
```js
var cid = new CreditorId( 'DE98ZZZ09999999999' ) // OR
var cid = CreditorId.parse( 'DE98ZZZ09999999999' )
``````js
CreditorId {
countryCode: 'DE',
checksum: '98',
businessCode: 'ZZZ',
nationalId: '09999999999'
}
```**Calculating and validating checksums**
```js
var checksum = cid.getChecksum() // > '98'
``````js
if( cid.check() ) {
// The CID's checksum is valid
}
```**Formatting a CID**
```js
cid.toString() // > 'DE98ZZZ09999999999'
```