New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@classytic/bd-areas

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@classytic/bd-areas

Bangladesh delivery areas with multi-provider support (RedX, Pathao, Steadfast) - 8 divisions, 64 districts, 2836+ areas

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

@classytic/bd-areas

Bangladesh delivery areas with multi-provider support. Contains 8 divisions, 64 districts, and 2836 areas with provider-specific IDs for RedX, Pathao, and Steadfast.

Installation

npm install @classytic/bd-areas

Features

  • Complete BD Coverage: 8 divisions, 64 districts, 2836 delivery areas
  • Multi-Provider Support: Area IDs for RedX, Pathao, Steadfast
  • TypeScript First: Full type definitions
  • Tree-Shakeable: Import only what you need
  • Browser + Node: Works in both environments

Usage

Frontend - Cascading Dropdowns

import {
  getDivisions,
  getDistrictsByDivision,
  getAreasByDistrict,
  searchAreas,
} from '@classytic/bd-areas';

// Get all divisions for first dropdown
const divisions = getDivisions();
// [{ id: 'dhaka', name: 'Dhaka', nameLocal: 'ঢাকা' }, ...]

// When user selects a division, get districts
const districts = getDistrictsByDivision('dhaka');
// [{ id: 'dhaka', name: 'Dhaka', divisionId: 'dhaka', ... }, ...]

// When user selects a district, get areas
const areas = getAreasByDistrict('dhaka');
// [{ internalId: 1, name: 'Mohammadpur', providers: { redx: 1 }, ... }, ...]

// Autocomplete search
const results = searchAreas('mirpur');

Backend - Area Resolution

import {
  getArea,
  resolveArea,
  getAreaByProvider,
  convertProviderId,
} from '@classytic/bd-areas';

// Get area by internal ID (from your database)
const area = getArea(1);
// { internalId: 1, name: 'Mohammadpur', providers: { redx: 1 }, ... }

// Get full area with division/district objects
const resolved = resolveArea(1);
// { ...area, division: { id: 'dhaka', name: 'Dhaka', ... }, district: { ... } }

// Get area by provider-specific ID
const areaFromRedx = getAreaByProvider('redx', 1);

// Convert between provider IDs
const pathaoId = convertProviderId('redx', 1, 'pathao');

API Reference

Division Functions

FunctionDescription
getDivisions()Get all 8 divisions
getDivisionById(id)Get division by ID
getDivisionByName(name)Get division by name

District Functions

FunctionDescription
getDistrictsByDivision(divisionId)Get districts in a division
getDistrictById(id)Get district by ID
getAllDistricts()Get all 64 districts

Area Functions

FunctionDescription
getArea(internalId)Get area by internal ID
getAreaByProvider(provider, providerId)Get area by provider-specific ID
getAreasByDistrict(districtId)Get areas in a district
getAreasByDivision(divisionId)Get areas in a division
getAreasByPostCode(postCode)Get areas by postal code
getAllAreas()Get all 2836 areas
searchAreas(query, limit?)Search areas by name/postcode/district
resolveArea(internalId)Get area with full division/district objects
convertProviderId(from, id, to)Convert between provider area IDs

Statistics

import { getStats } from '@classytic/bd-areas';

const stats = getStats();
// {
//   divisions: 8,
//   districts: 64,
//   areas: 2836,
//   providerCoverage: { redx: 2836, pathao: 0, steadfast: 0 },
//   byDivision: [{ division: 'Dhaka', districts: 13, areas: 1295 }, ...]
// }

Types

interface Division {
  id: string;
  name: string;
  nameLocal: string; // Bengali name
}

interface District {
  id: string;
  name: string;
  divisionId: string;
  divisionName: string;
}

interface Area {
  internalId: number;  // Use this in your database
  name: string;
  postCode: number | null;
  zoneId: number;
  districtId: string;
  districtName: string;
  divisionId: string;
  divisionName: string;
  providers: {
    redx?: number;
    pathao?: number;
    steadfast?: number;
  };
}

Best Practices

Store Internal ID in Your Database

// When saving customer address
const area = searchAreas('mohammadpur')[0];
await saveAddress({
  areaId: area.internalId,  // Store this
  areaName: area.name,
  district: area.districtName,
  division: area.divisionName,
});

Get Provider ID When Making API Calls

// When creating shipment with RedX
const area = getArea(savedAddress.areaId);
const redxAreaId = area.providers.redx;

await redxClient.createParcel({
  deliveryAreaId: redxAreaId,
  // ...
});

License

MIT © Classytic

Keywords

bangladesh

FAQs

Package last updated on 14 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts