New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nuban

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuban

Helper library when working with nuban accounts

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
348
-11.9%
Maintainers
1
Weekly downloads
 
Created
Source

nuban Build Status

Helper library when working with nuban accounts

Installation

This is a Node.js module available through the npm registry. It can be installed using the npm or yarn command line tools.

npm install nuban --save

Usage

The module exposes 2 functions. Samples and an explanation follows:

Validate a nuban account number against a bank's code

Use the library's validate function to confirm that the account number is valid for the bank. Format is:

    nuban.validate(accountNumber, bankCode);
    const valid = nuban.validate("0123456789","011");

Calculate check digit

Use the library's calculateCheckDigit function to get the check digit for a nuban account's first 9 digits. Format is:

    nuban.calculateCheckDigit(first9, bankCode);

Note that this function throws a NubanValidationError if either the first9 or bank code are invalid according to a regex check so it should be called in a try block.

    let checkDigit = null;
    try {
        checkDigit = nuban.calculateCheckDigit("012345678","011");
    } catch(err){
        console.error(err);
    }

Tests

npm install
npm test

> nuban@1.0.6 test /Users/i/plop/nuban
> node test.js
ok

Dependencies

None

Dev Dependencies

None

License

MIT

Keywords

nuban

FAQs

Package last updated on 23 Jan 2023

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