iban
Version:
A javascript library to validate, format and convert IBAN (International Bank Account Number) and BBAN (Basic Bank Account Number)
58 lines (41 loc) • 1.93 kB
Markdown
[](https://badge.fury.io/js/iban)
[](https://raw.githubusercontent.com/arhs/iban.js/master/LICENSE)
IBAN and BBAN validation, formatting and conversion in Javascript.
Check the demo on [demo page] to try it.
[]: https://arhs.github.io/iban.js/
IBAN.js follows the [ISO 13616 IBAN Registry technical specification](https://www.swift.com/standards/data-standards/iban).
IBAN.js is compatible with both commonjs and AMD module definition. It can be used as a [node.js module](
```js
var IBAN = require('iban');
IBAN.isValid('hello world'); // false
IBAN.isValid('BE68539007547034'); // true
```
Using a module loader (AMD or commonjs) or directly through the global ```IBAN``` object:
```html
<script src="iban.js"></script>
<script>
// the API is now accessible from the window.IBAN global object
IBAN.isValid('hello world'); // false
IBAN.isValid('BE68539007547034'); // true
</script>
```
The library is also available from the typescript language. To do this, [download the definition](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iban) and add a reference to this:
```typescript
/// <reference path="iban.d.ts" />
IBAN.isValid('hello world');
IBAN.isValid('BE68539007547034');
```
A wrapper package for the Meteor framework is available [here](https://atmospherejs.com/theduke/iban).
* isValid(iban)
* toBBAN(iban, separator)
* fromBBAN(countryCode, bban)
* isValidBBAN(countryCode, bban)
* printFormat(iban, separator)
* electronicFormat(iban)