1.0.0 • Published 1 year ago
iban-validator-2.0 v1.0.0
IBAN Validator
This is a JavaScript function that validates International Bank Account Numbers (IBANs) according to the IBAN standard. It checks the syntax, length, and checksum of the provided IBAN.
Usage
To use the IBAN validator, follow these steps:
Installation
Install the IBAN validator package using npm:
npm install iban-validator
Import
Import the IBAN validator function into your JavaScript code:
const { isValidIBANNumber } = require('iban-validator');
If you're using ES6 modules:
import { isValidIBANNumber } from 'iban-validator';
Validation
Use the
isValidIBANNumber
function to validate an IBAN:const iban = 'GB82WEST12345698765432'; const isValid = isValidIBANNumber(iban); console.log(`Is IBAN ${iban} valid? ${isValid}`);
Example
const { isValidIBANNumber } = require('iban-validator');
function alertValidIBAN(iban) {
alert(isValidIBANNumber(iban));
}
const iban = 'GB82WEST12345698765432';
alertValidIBAN(iban);
This will alert a message indicating whether the provided IBAN (GB82WEST12345698765432
in this case) is valid or not.
Note
This package follows the IBAN standard and checks the syntax, length, and checksum of IBANs. However, it does not verify if the IBAN corresponds to a real bank account.
1.0.0
1 year ago