npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

israeli-bank-autocomplete

v2.0.2

Published

Autocomplete for banks in israel

Downloads

52

Readme

Israeli Bank Autocomplete

Autocomplete for banks in Israel

Installation

npm i israeli-bank-autocomplete

About

This package will help with fetching the data from data.gov.il and searching in the data. The package doesn't contain the data itself. Before calling fetchNewDataFromDataGov make sure to read the terms of use of data.gov.il.

This package uses the following data source 2202bada-4baf-45f5-aa61-8c5bad9646d3. Please review this page too.

Importing

const BankDataSource = require("israeli-bank-autocomplete");

Initialization

First get the bank-data.json file by running

const bankDataSource = new BankDataSource();
await bankDataSource.fetchNewDataFromDataGov('<resourceId>', 1600);
fs.writeFileSync('bank-data.json', JSON.stringify(bankDataSource.exportBankData()));

This will generate the bank-data.json. Make sure to save it, and load the data from it.

import data from './bank-data.json';
const bankDataSource = new BankDataSource(data);

or just run fetchNewDataFromDataGov every time to create a new instance:

const bankDataSource = new BankDataSource();
await bankDataSource.fetchNewDataFromDataGov('<resourceId>', 1600);

When calling fetchNewDataFromDataGov, make sure that you know the limits of calling data.gov.il.

The function fetchNewDataFromDataGov needs to get the resourceId and a limit. The supported resourceId is 2202bada-4baf-45f5-aa61-8c5bad9646d3, and currently a limit of 1600 will return all the results. If you pick a limit that is too low, you will get a warning.

Get autocomplete suggestions

To get bank branches based on a name or a branch code

let suggestions = bankDataSource.getAutocompleteSuggestions("חדר", { bankCode: 12 });
/*
suggestions = [
  {
    bankCode: 12,
    bankName: 'בנק הפועלים בע"מ',
    branchCode: 620,
    branchName: 'חדרה',
    branchAddress: 'הרברט סמואל 85 ',
    city: 'חדרה',
    zip: '',
    postCode: '',
    phone: '04-6329583',
    fax: '',
    freePhone: '',
    accessForDisabled: 'כן',
    closedDay: 'יום ו',
    type: 'רגיל',
    openDate: '01/01/1949',
    closingDate: '',
    mergeBank: '',
    mergeBranch: '',
    xCoordinate: '34.921286',
    yCoordinate: '32.436023'
  }
]
*/

The function getAutocompleteSuggestions takes two parameters

| Argument Name | Description | Format | | ------------- | --------------- | ------------------- | | input | the users input | String | | options | options | AutocompleteOptions |

AutocompleteOptions

| Argument Name | Description | Format | | ------------- | ------------------------------------------------------- | -------------------------------- | | bankCode | get suggestions only for the given bank | Number | | inputType | get the suggestions only based on branch name/code/both | BRANCH_CODE / BRANCH_NAME / BOTH |

Get All Banks

To get all banks use the following function

let banks = bankDataSource.getAllBanks();
/*
banks = [
    { bankCode: 22, bankName: 'Citibank'},
    { bankCode: 23, bankName: 'HSBC'},
    { bankCode: 18, bankName: 'One  Zero - הבנק הדיגיטלי בע"מ'},
    { bankCode: 39, bankName: 'SBI State Bank of India'},
    { bankCode: 13, bankName: 'בנק אגוד לישראל בע"מ'},
    { bankCode: 14, bankName: 'בנק אוצר החייל בע"מ'},
    { bankCode: 11, bankName: 'בנק דיסקונט לישראל בע"מ'},
    { bankCode: 31, bankName: 'בנק הבינלאומי הראשון לישראל בע"מ'},
    { bankCode: 12, bankName: 'בנק הפועלים בע"מ'},
    { bankCode: 4, bankName: 'בנק יהב לעובדי המדינה בע"מ'},
    { bankCode: 54, bankName: 'בנק ירושלים בע"מ'},
    { bankCode: 99, bankName: 'בנק ישראל'},
    { bankCode: 10, bankName: 'בנק לאומי לישראל בע"מ'},
    { bankCode: 20, bankName: 'בנק מזרחי טפחות בע"מ'},
    { bankCode: 46, bankName: 'בנק מסד בע"מ'},
    { bankCode: 17, bankName: 'בנק מרכנתיל דיסקונט בע"מ'},
    { bankCode: 52, bankName: 'בנק פועלי אגודת ישראל בע"מ'},
    { bankCode: 26, bankName: 'יובנק בע"מ'},
    { bankCode: 50, bankName: 'מרכז סליקה בנקאי בע"מ'},
    { bankCode: 59, bankName: 'שירותי בנק אוטומטיים'},
    { bankCode: 9, bankName: 'בנק הדואר'}
]
*/

Get all branches

To get all the branches use bankDataSource.getAllBranches().