Skip to content
/ iban.js Public
forked from arhs/iban.js

TypeScript library designed for validating, formatting, and converting International Bank Account Numbers (IBAN) and Basic Bank Account Numbers (BBAN).

License

Notifications You must be signed in to change notification settings

altrim/iban.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iban-ts

Overview

iban-ts is a TypeScript library forked from iban.js, designed for validating, formatting, and converting International Bank Account Numbers (IBAN) and Basic Bank Account Numbers (BBAN).

Installation

To install iban-ts, use npm or yarn:

npm install iban-ts
# or
yarn add iban-ts

Usage

Importing the Library

You can import the entire library or specific functions:

import * as IBAN from 'iban-ts';
// or
import { isValid, toBBAN, fromBBAN } from 'iban-ts';

Validating an IBAN

To check if an IBAN is valid:

const valid = IBAN.isValid('DE89370400440532013000');
console.log(valid); // true or false

Converting BBAN to IBAN

To convert a BBAN to an IBAN:

const iban = IBAN.fromBBAN('DE', '370400440532013000');
console.log(iban); // DE89370400440532013000

Formatting an IBAN

To format an IBAN for printing:

const formatted = IBAN.printFormat('DE89370400440532013000', ' ');
console.log(formatted); // DE89 3704 0044 0532 0130 00

API

* isValid(iban)
* toBBAN(iban, separator)
* fromBBAN(countryCode, bban)
* isValidBBAN(countryCode, bban)
* printFormat(iban, separator)
* electronicFormat(iban)

About

TypeScript library designed for validating, formatting, and converting International Bank Account Numbers (IBAN) and Basic Bank Account Numbers (BBAN).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%