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

@bangladeshi/bangladesh-address

v2.1.0

Published

A simple npm package for Bangladesh's administrative divisions, districts, upazilas, and metropolitan thanas.

Readme

Bangladesh Address (division, district, upazila, thana)

A simple npm package that exports methods representing divisions, districts, upazilas and thanas (metropolitan police stations) of Bangladesh.

Data Coverage

  • 8 Divisions - All administrative divisions
  • 64 Districts - All districts
  • 495 Upazilas - All upazilas (updated July 2021 with Eidgaon, Dasar, Madhyanagar)
  • 26 Metropolitan Thanas - Police stations in Dhaka, Chattogram, Rajshahi, Khulna

Installation

npm i @bangladeshi/bangladesh-address

Usage

CommonJS

const address = require('@bangladeshi/bangladesh-address')

ES Modules / TypeScript

import { allDivision, districtsOf, upazilasOf, DivisionName } from '@bangladeshi/bangladesh-address'

API Reference

Division

allDivision()
// Returns: ['Dhaka', 'Chattogram', 'Mymensingh', ...]

divisionalDataOf(DivisionName.Dhaka)
// Returns: All districts and upazilas of Dhaka division

Districts

districtsOf(DivisionName.Dhaka)
// Returns: Districts of Dhaka division

allDistricts()
// Returns: Array of all 64 district names

Upazilas

upazilasOf("Tangail")
// Returns: Array of upazila objects for Tangail district

upazilaNamesOf("Tangail")
// Returns: Array of upazila names (strings) for Tangail district

allUpazila()
// Returns: Array of all 495 upazila names

isUpazila("Savar")
// Returns: true (Savar is an upazila)

getUpazila("Savar")
// Returns: { upazila: "Savar", district: "Dhaka", division: "Dhaka" }

Thanas (Metropolitan Police Stations)

allThana()
// Returns: Array of all 26 thana objects

allThanaNames()
// Returns: Array of all 26 thana names (strings)

thanasOf("Dhaka")
// Returns: Array of thana objects for Dhaka (15 thanas)

thanaNamesOf("Dhaka")
// Returns: Array of thana names (strings) for Dhaka

isThana("Gulshan")
// Returns: true (Gulshan is a metropolitan thana)

isThana("Savar")
// Returns: false (Savar is an upazila, not a thana)

isThana("Kotwali", "Dhaka")
// Returns: true (disambiguate with district context)

getThana("Gulshan")
// Returns: { thana: "Gulshan", district: "Dhaka", division: "Dhaka" }

getThana("Kotwali", "Chattogram")
// Returns: { thana: "Kotwali", district: "Chattogram", division: "Chattogram" }

Validation Functions

isValidDivision("Dhaka")
// Returns: true

isValidDivision("InvalidName")
// Returns: false

isValidDistrict("Tangail")
// Returns: true

isValidDistrict("Savar")
// Returns: false (Savar is an upazila, not a district)

Reverse Lookups

getDivisionOfDistrict("Tangail")
// Returns: "Dhaka"

getDivisionOfDistrict("Cox's Bazar")
// Returns: "Chattogram"

getDistrictOfUpazila("Savar")
// Returns: "Dhaka"

getDistrictOfUpazila("Mohammadpur", "Khulna")
// Returns: "Magura" (disambiguate with division context)

Get Upazilas by Division

upazilasOfDivision("Sylhet")
// Returns: Array of all upazila objects in Sylhet division

upazilaNamesOfDivision("Sylhet")
// Returns: Array of all upazila names (strings) in Sylhet division

Search Locations

searchLocations("pur")
// Returns: Array of matching locations across divisions, districts, upazilas, and thanas
// [
//   { name: "Rangpur", type: "division" },
//   { name: "Rangpur", type: "district", division: "Rangpur" },
//   { name: "Mirpur", type: "thana", district: "Dhaka", division: "Dhaka" },
//   ... more matches
// ]

Raw Data Access

import { upazilaData, thanaData } from '@bangladeshi/bangladesh-address'

// upazilaData: Array of all 495 upazila objects
// thanaData: Array of all 26 thana objects

Types

import { DivisionName, DistrictName, Upazila, Thana, SearchResult } from '@bangladeshi/bangladesh-address'

// Division enum
DivisionName.Dhaka
DivisionName.Chattogram
DivisionName.Mymensingh
DivisionName.Khulna
DivisionName.Rajshahi
DivisionName.Rangpur
DivisionName.Sylhet
DivisionName.Barisal

// DistrictName type (all 64 districts)
type DistrictName = "Dhaka" | "Chattogram" | "Khulna" | ... // 64 districts

// Upazila interface
interface Upazila {
  upazila: string;
  district: string;
  division: string;
}

// Thana interface
interface Thana {
  thana: string;
  district: string;
  division: string;
  type: "thana";
}

Metropolitan Thana Distribution

| City | Thana Count | |------|-------------| | Dhaka | 15 | | Chattogram | 6 | | Khulna | 3 | | Rajshahi | 2 |

Database Dumps (For Non-JavaScript Projects)

If you're using PHP, Python, Java, Go, Ruby, or any other language, you can use our pre-built database dumps instead of the npm package.

Available Formats

| Database | File | |----------|------| | MySQL | db/mysql/bangladesh-address.sql | | PostgreSQL | db/postgresql/bangladesh-address.sql | | SQLite | db/sqlite/bangladesh-address.sql | | MongoDB | db/mongodb/ |

Quick Import

# MySQL
mysql -u username -p database_name < db/mysql/bangladesh-address.sql

# PostgreSQL
psql -U username -d database_name -f db/postgresql/bangladesh-address.sql

# SQLite
sqlite3 bangladesh.db < db/sqlite/bangladesh-address.sql

# MongoDB
mongoimport --db bangladesh --collection divisions --file db/mongodb/divisions.json --jsonArray

See db/README.md for full documentation, schema details, and example queries.

Contribution

If you want to contribute please follow the guideline. Contribution