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

bd-geojson

v1.0.5

Published

Open-source geographic data for Bangladesh — divisions, districts, upazilas, postcodes, and full boundary GeoJSON.

Readme

bd-geojson

npm version License: MIT Validate Demo

Open-source geographic data for Bangladesh — divisions, districts, upazilas, postcodes, and full boundary GeoJSON. Free, accurate, and community-maintained.

Demo: https://y3454r.github.io/bd-geodata · GitHub: https://github.com/Y3454R/bd-geodata

Quick Start

npm install bd-geojson
import bd from 'bd-geojson';

bd.getDivisions();              // 8 divisions
bd.getDistrictsByDivision('3'); // districts in Dhaka division
bd.getUpazilasByDistrict('1');  // upazilas in Dhaka district
bd.search('সিলেট');             // search EN + Bangla names
bd.getFullHierarchy();          // full division → district → upazila tree

You can also import the raw JSON files directly:

import divisions from 'bd-geojson/divisions';
import boundary from 'bd-geojson/boundary';

What's Inside

| File | Records | Description | |------|---------|-------------| | bd-divisions.json | 8 | Divisions with EN/BN names + coordinates | | bd-districts.json | 64 | Districts mapped to divisions | | bd-upazilas.json | 494 | Upazilas mapped to districts | | bd-postcodes.json | 1,349 | Post offices and post codes | | bangladesh.geojson | — | Full boundary polygons (~7MB) | | dhaka-city.json | — | Dhaka city / city corporation areas |

All names are bilingual (English + বাংলা).

Data Shape

interface Division  { id; name; bn_name; lat; long }
interface District  { id; division_id; name; bn_name; lat; long }
interface Upazila   { id; district_id; name; bn_name }
interface Postcode  { division_id; district_id; upazila; postOffice; postCode }

See src/types.ts for the full TypeScript definitions.

API

| Function | Returns | |----------|---------| | getDivisions() | Division[] | | getDivisionById(id) | Division \| undefined | | getDistricts() | District[] | | getDistrictById(id) | District \| undefined | | getDistrictsByDivision(divisionId) | District[] | | getUpazilas() | Upazila[] | | getUpazilaById(id) | Upazila \| undefined | | getUpazilasByDistrict(districtId) | Upazila[] | | getPostcodes() | Postcode[] | | getPostcodesByDistrict(districtId) | Postcode[] | | search(query) | SearchResult[] (matches EN + Bangla) | | getFullHierarchy() | nested tree |

More examples in docs/USAGE.md.

Use Cases

  • E-commerce — shipping address dropdowns, delivery zones, postcode lookup
  • Logistics — route planning across divisions and districts
  • NGO / Government — beneficiary mapping, coverage reporting
  • Fintech — KYC address validation
  • Civic tech — election visualizations, public service maps
  • Education — teaching geography, building Bangla-first apps

Demo Site

The demo at y3454r.github.io/bd-geodata lets you:

  • Search any division, district, or upazila by EN or Bangla name
  • Browse the full hierarchy with cascade dropdowns
  • See the boundary on a MapLibre map (OpenFreeMap tiles)
  • Copy any record as JSON in one click

Run it locally:

npm install
npm run demo:install
npm run demo:dev

Contributing

Found wrong coordinates? A missing upazila? A typo in a Bangla name? PRs are very welcome.

See docs/CONTRIBUTING.md. Data validation runs automatically on every PR.

Validation

Before submitting a data PR, run:

node scripts/validate-data.js

This checks structure, required fields, referential integrity, coordinate bounds, and duplicate IDs.

License

This project uses two licenses:

  • Code (the npm package, demo site, scripts) — MIT. Free for any use, commercial or otherwise.
  • Data files derived from OpenStreetMapODbL 1.0. Specifically bd-bazars.geojson and bd-major-routes.geojson. ODbL requires attribution and share-alike on derived databases.
  • Boundary data (bangladesh.geojson) — CC BY 4.0, sourced from geoBoundaries (gbOpen, ADM3). Underlying authority: Bangladesh Bureau of Statistics (BBS) / OCHA ROAP.
  • Administrative reference data (bd-divisions.json, bd-districts.json, bd-upazilas.json, bd-postcodes.json, dhaka-city.json) — community-contributed, MIT.

Attribution when using OSM-derived layers:

© OpenStreetMap contributors — odbl-1.0

See metadata.attribution inside each derived GeoJSON for the exact string.

Credits

Maintained by @Y3454R and contributors. Originally forked from bangladesh-geojson by @ifahimreza. Map tiles by OpenFreeMap.