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 🙏

© 2026 – Pkg Stats / Ryan Hefner

iran-lib

v1.0.22

Published

A TypeScript library providing utilities and data related to Iran.

Readme

Iran-Lib Github npm version Star on GitHub

Description

iran-lib is a TypeScript library providing a collection of utilities, data, and functionality related to Iran. It includes helpful modules for handling provinces and cities, bank information, and other general-purpose utilities for projects related to Iran.


Installation

Install the library via npm or yarn or pnpm:

npm install iran-lib

or

yarn add iran-lib

or

pnpm add iran-lib

Features

  • Provinces and Cities

    • Fetch provinces and their respective cities.
    • Find cities by province name or provinces by city name.
  • Bank Information

    • Get information about Iranian banks, including bank prefixes and names.
    • Lookup bank names by prefixes or prefixes by bank names.
  • National ID

    • Get city and province information based on national ID prefixes.
    • Retrieve city names by prefixes and vice versa.
  • More to Come!

    • This library is designed to expand with additional Iran-related utilities and datasets in the future.

Usage

National ID

Using the Hook

import { useNationalIdData } from "iran-lib-extended";

const { specificCityByPrefix } = useNationalIdData({
    getCityByPrefix: "169",
});

console.log(specificCityByPrefix); // { prefix: "169", city: "آذرشهر" }

Using the Class

import { NationalId } from "iran-lib-extended";

const nationalIdInstance = new NationalId();

const city = nationalIdInstance.getCityByPrefix("169");
const prefix = nationalIdInstance.getPrefixByCity("آذرشهر");

console.log(city); // { prefix: "169", city: "آذرشهر" }
console.log(prefix); // "169"

Provinces and Cities

Using the Hook

import { useIranProvincesAndCities } from "iran-lib";

const { data, specificProvinceCities } = useIranProvincesAndCities({
    getCitiesByProvinceName: "Tehran",
});

console.log(data); // Full provinces and cities data
console.log(specificProvinceCities); // Cities in Tehran province

Using the Class

import { Provinces } from "iran-lib";

const provincesInstance = new Provinces();

const allProvinces = provincesInstance.getProvinces();
const tehranCities = provincesInstance.getCitiesByProvince("Tehran");
const provinceOfCity = provincesInstance.getProvinceByCityName("Qom");

console.log(allProvinces);
console.log(tehranCities);
console.log(provinceOfCity);

Bank Information

Using the Hook

import { useBankData } from "iran-lib";

const { specificBankByPrefix } = useBankData({
    getBankByPrefix: "603799",
});

console.log(specificBankByPrefix); // { prefix: "603799", bankName: "\u0645\u0644\u06cc" }

Using the Class

import { Banks } from "iran-lib";

const banksInstance = new Banks();

const allBanks = banksInstance.getBanks();
const bank = banksInstance.getBankByPrefix("603799");
const prefix = banksInstance.getPrefixByBankName("\u0645\u0644\u06cc");

console.log(allBanks);
console.log(bank);
console.log(prefix);

Data Sources

  • Province and City Data: Comprehensive dataset of Iranian provinces and their respective cities.
  • Bank Data: List of Iranian banks and their prefixes.
  • National ID Data: Data for Iranian national ID prefixes and related cities/provinces.

Contributing

Contributions are welcome! If you have ideas or improvements, feel free to open an issue or submit a pull request.


License

This project is licensed under the MIT License.


Future Plans

  • More datasets related to Iran's infrastructure and culture.

Support

If you encounter any issues or have questions, feel free to open an issue on GitHub.