Skip to content

JavaScript module for Israeli Bank Account validation (sanity checking) if an account number is valid for a particular Israeli bank and branch.

License

Notifications You must be signed in to change notification settings

soryy708/il-bank-account-validator

Repository files navigation

Israeli Bank Account Validator

Israeli Bank Account Validator provides validation utilities for Israeli bank account numbers. You can use it to present appropriate UI to your user as they type. This is a JavaScript module.

It can be used both on the front end (if browserified or imported as JS Module), and on the back end as a NodeJS module.

Installation

You can install il-bank-account-validator through npm.

npm install il-bank-account-validator

Example

In Node:

var validator = require('il-bank-account-validator');

// TODO: Set to your real info
var bank = 0;
var branch = 0;
var account = 0;

console.log("My details are:", bank, branch, account);
console.log("Am I valid?");
if(validator(bank, branch, account)) {
    console.log("Yes!");
} else {
    console.log("No!");
}

In the browser JS-Modules and <script> tags:

<script type="module">
  import bankAccountValidation from 'il-bank-account-validator';

  if (bankAccountValidation(bankNumber, branchNumber, accountNumber)) {
    renderFullyValidAccountNumber();
  } else if (!accountValidation.isPotentiallyValid) {
    renderInvalidAccountNumber();
  }
</script>

If you need to support browsers that don't support JS-Modules (like Internet Explorer, Safari iOS <10.3), you can instead use a bundler like Webpack.

About

JavaScript module for Israeli Bank Account validation (sanity checking) if an account number is valid for a particular Israeli bank and branch.

Resources

License

Stars

Watchers

Forks

Packages

No packages published