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

iban-ts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iban-ts

A TypeScript library for validating, formatting, and converting IBAN (International Bank Account Number) and BBAN (Basic Bank Account Number), offering comprehensive support for international banking data standards.

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.1K
decreased by-2.59%
Maintainers
1
Weekly downloads
 
Created
Source

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)

FAQs

Package last updated on 01 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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