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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zipcity-bd

v1.0.11

Published

A Bangladesh-based zipcode package to get your Divisions, Districts, City, Sub-City with PostalCode in just seconds.

Readme

⛓ zipcity-bd

"A Bangladeshi ZipCode Package" A Bangladesh-based zipcode package to get your Divisions, Districts, City, Sub-City with PostalCode in just seconds.

Description

This npm package provides postal codes, subdivision names, and village names for different divisions in Bangladesh. You can use this package to easily retrieve location data such as subdivision names and their corresponding postal codes.

Installation

npm install zipcity-bd

require 'zipcity-bd' into your code

const zip = require("zipcity-bd")

console.log(zip.data.Dhaka)
console.log(zip.data.Rajshahi)

Or, for ❛better readability❜ of your code:

const { data } = require("zipcity-bd")

// Use zip.<anyDistrictName> to get all of it's sub Districts and Village names with Postal Codes
// Example:

console.log(data.Dhaka)
console.log(data.Rajshahi)
// Try yourself logging into the terminal!

Practical Usage Examples:

Iterating over the elements.

You can loop and iterate over them by simply,

const { data } = require("zipcity-bd")

let dhakaArr = data.Dhaka
console.log("Dhaka:")
for (let i = 0; i < dhakaArr.length; i++) {
  console.log(
    `Sub-District: ${dhakaArr[i].subDistrict}\nVillage: ${dhakaArr[i].village}\nPostal Code: ${dhakaArr[i].postalCode}\n`
  )
}

/*
    Output Example:
    
    //...
    
    Sub-Division: Tejgaon Industrial Area
    Village: Dhaka Politechnic
    Postal Code: 1208
    
    // ...

*/

Featured Functions:

searchByDistrict Allows to search by District Names.

const { searchByDistrict } = require("zipcity-bd")

let dhakaDistrict = searchByDistrict("Dhaka")
let rajshahiDistrict = searchByDistrict("Rajshahi")

// logging returned value
console.log(dhakaDistrict)
console.log(rajshahiDistrict)

// Even works with partial word match

searchByDistrict("Dha") // returns same value as "Dhaka"
searchByDistrict("shahi") // returns same value as "Rajshahi"

searchByCity Allows to search by City Names.

const { searchByCity } = require("zipcity-bd")

let mirpurCity = searchByCity("Mirpur")
let ishwardiCity = searchByCity("Ishwardi")

// logging returned value
console.log(mirpurCity)
console.log(ishwardiCity)

// Works with partial word match
searchByCity("Mir") // returns same value as "Mirpur"
searchByCity("Ishwar") // returns same value as "Ishwardi"

searchBySub Allows to search by Sub-City/Thana/Union Names.

const { searchBySub } = require("zipcity-bd")

let dhapariSubCity = searchBySub("Dhapari")
let pakshiSubCity = searchBySub("Pakshi")

// logging returned value
console.log(dhapariSubCity)
console.log(pakshiSubCity)

// Works with partial word match
searchBySub("Dha") // returns same value as "Dhapari"
searchBySub("Pak") // returns same value as "Pakshi"

searchByCode Using postalCode to search the District, subDistrict and City

const { searchByCode } = require("zipcity-bd")

console.log(searchByCode(6640)) // Bhangura
console.log(searchByCode(1212)) // Gulshan's postalCode

// Returns empty array if no data found.

🧊 Summary Code

const {
  data,
  searchByDistrict,
  searchByCity,
  searchBySub,
  searchByCode,
} = require("zipcity-bd")

console.log(searchByDistrict("Rajshahi")) // Searchs all sub-Districts with Village name and Postal Codes
console.log(searchByCity("Ishwardi")) // Finds with City name with Postal Code
console.log(searchBySub("Sathia")) // Finds with Sub-City name with Postal Code
console.log(searchByCode(3000)) // Searchs with Postal Code with Village and Postal Code.

Don't forget to star my repo if it helped! <3 Happy coding, AssalamuAlaikum!

Author: Ettisaf Rup