all-bangladeshi-addresses 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +303 -0
- package/dist/data/allDataBN.json +3710 -0
- package/dist/data/allDataEN.json +720 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +113 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.js +2 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# all-bangladeshi-addresses
|
|
2
|
+
|
|
3
|
+
A lightweight TypeScript/JavaScript library that provides **Bangladesh address data** (Division, District, Upazila, Thana) in both **English** and **Bangla**, plus convenient helper functions to query and summarize the data.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This package bundles curated administrative data of Bangladesh and exposes a set of functions to:
|
|
10
|
+
|
|
11
|
+
- List divisions, districts, upazilas, and thanas in English and Bangla.
|
|
12
|
+
- Drill down by division or district.
|
|
13
|
+
- Use strongly typed objects in TypeScript.
|
|
14
|
+
|
|
15
|
+
The library is shipped as compiled JavaScript with type definitions, so consumers can use it directly without access to the original source.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Key Features
|
|
20
|
+
|
|
21
|
+
- **Bilingual data** – English and Bangla datasets kept in sync.
|
|
22
|
+
- **Administrative hierarchy** – Division → District → Upazila → Thana.
|
|
23
|
+
- **Convenience helpers** – One‑line calls for common lookups.
|
|
24
|
+
- **Aggregate helpers** – Total counts for each administrative level.
|
|
25
|
+
- **Case‑insensitive English lookups** – `"Dhaka"`, `"dhaka"`, `"DHAKA"` all work.
|
|
26
|
+
- **TypeScript support** – Exported interfaces and `.d.ts` files.
|
|
27
|
+
- **Production‑ready build** – Published as compiled code only.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Data Coverage
|
|
32
|
+
|
|
33
|
+
The package aims to cover:
|
|
34
|
+
|
|
35
|
+
- **All 8 divisions** of Bangladesh.
|
|
36
|
+
- **All districts** under each division.
|
|
37
|
+
- **All upazilas** under each district.
|
|
38
|
+
- **All thanas (police stations)** mapped to their upazila, district, and division.
|
|
39
|
+
|
|
40
|
+
Each data row has the shape:
|
|
41
|
+
|
|
42
|
+
- English: `{ thana, upazilla, district, division }`
|
|
43
|
+
- Bangla: `{ thana, upazilla, district, division }` (names localized to Bangla script)
|
|
44
|
+
|
|
45
|
+
> Note: Administrative structures can change over time. If you find missing or updated units, please report them via the repository issue tracker or contact the author.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install all-bangladeshi-addresses
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
### Basic example (TypeScript / modern Node)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
import { allDivisionEN, allDivisionBN } from "all-bangladeshi-addresses";
|
|
65
|
+
|
|
66
|
+
# All English division names
|
|
67
|
+
const divisionsEN = allDivisionEN();
|
|
68
|
+
|
|
69
|
+
# All Bangla division names
|
|
70
|
+
const divisionsBN = allDivisionBN();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## API Reference
|
|
76
|
+
|
|
77
|
+
Below is a concise reference grouped by language and level.
|
|
78
|
+
|
|
79
|
+
### English API
|
|
80
|
+
|
|
81
|
+
#### Divisions
|
|
82
|
+
|
|
83
|
+
##### `allDivisionEN(): string[]`
|
|
84
|
+
|
|
85
|
+
Return all **unique English division names**.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
const divisions = allDivisionEN();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
##### `divisionalDataENOf(divisionName: string): AddressDataEN[]`
|
|
93
|
+
|
|
94
|
+
Return all English records (thana rows) under the given **division**.
|
|
95
|
+
Lookup is **case‑insensitive** on `divisionName`.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
const dhakaRecords = divisionalDataENOf("dhaka");
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
#### Districts
|
|
105
|
+
|
|
106
|
+
##### `districtENOf(divisionName: string): string[]`
|
|
107
|
+
|
|
108
|
+
Return all **unique English districts** under the specified **division**.
|
|
109
|
+
`divisionName` is case‑insensitive.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
const dhakaDistricts = districtENOf("Dhaka");
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
##### `allDistrictEN(): string[]`
|
|
117
|
+
|
|
118
|
+
Return all **unique English district names**.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
const districts = allDistrictEN();
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
#### Upazilas
|
|
127
|
+
|
|
128
|
+
##### `upazillasENOf(districtName: string): string[]`
|
|
129
|
+
|
|
130
|
+
Return all **unique English upazila names** under the specified **district**.
|
|
131
|
+
`districtName` is case‑insensitive.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
const upazilas = upazillasENOf("Narsingdi");
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
##### `allUpazillaEN(): string[]`
|
|
139
|
+
|
|
140
|
+
Return all **unique English upazila names**.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
const allUpazilas = allUpazillaEN();
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
#### Thanas
|
|
150
|
+
|
|
151
|
+
##### `thanasENOf(districtName: string): string[]`
|
|
152
|
+
|
|
153
|
+
Return all **unique English thana names** under the specified **district**.
|
|
154
|
+
`districtName` is case‑insensitive.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
const narsingdiThanas = thanasENOf("Narsingdi");
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
##### `allThanaEN(): string[]`
|
|
162
|
+
|
|
163
|
+
Return all **unique English thana names**.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
const allThanas = allThanaEN();
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Bangla API
|
|
172
|
+
|
|
173
|
+
The Bangla API mirrors the English one, but with Bangla strings.
|
|
174
|
+
|
|
175
|
+
#### Divisions
|
|
176
|
+
|
|
177
|
+
##### `allDivisionBN(): string[]`
|
|
178
|
+
|
|
179
|
+
Return all **unique Bangla division names**.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
const divisionsBn = allDivisionBN();
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
##### `divisionalDataBNOf(divisionName: string): AddressDataBN[]`
|
|
187
|
+
|
|
188
|
+
Return all Bangla records (thana rows) for the specified Bangla **division** name.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
const dhakaBnRecords = divisionalDataBNOf("ঢাকা");
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
#### Districts
|
|
198
|
+
|
|
199
|
+
##### `districtBNOf(divisionName: string): string[]`
|
|
200
|
+
|
|
201
|
+
Return all **unique Bangla districts** under the given Bangla **division**.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
const dhakaBnDistricts = districtBNOf("ঢাকা");
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
##### `allDistrictBN(): string[]`
|
|
209
|
+
|
|
210
|
+
Return all **unique Bangla district names**.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
const allDistrictsBn = allDistrictBN();
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
#### Upazilas
|
|
220
|
+
|
|
221
|
+
##### `upazillasBNOf(districtName: string): string[]`
|
|
222
|
+
|
|
223
|
+
Return all **unique Bangla upazila names** under the specified Bangla **district**.
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
const narsingdiUpazilasBn = upazillasBNOf("নরসিংদী");
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
##### `allupazillaBN(): string[]`
|
|
231
|
+
|
|
232
|
+
Return all **unique Bangla upazila names**.
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
const allUpazilasBn = allupazillaBN();
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
#### Thanas
|
|
242
|
+
|
|
243
|
+
##### `thanasBNOf(districtName: string): string[]`
|
|
244
|
+
|
|
245
|
+
Return all **unique Bangla thana names** under the specified Bangla **district**.
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
const narsingdiThanasBn = thanasBNOf("নরসিংদী");
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
##### `allThanaBN(): string[]`
|
|
253
|
+
|
|
254
|
+
Return all **unique Bangla thana names**.
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
const allThanasBn = allThanaBN();
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Types
|
|
264
|
+
|
|
265
|
+
If you are using TypeScript, you can import the data interfaces:
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
import type { AddressDataEN, AddressDataBN } from "all-bangladeshi-addresses";
|
|
270
|
+
|
|
271
|
+
const enRows: AddressDataEN[] = [];
|
|
272
|
+
const bnRows: AddressDataBN[] = [];
|
|
273
|
+
|
|
274
|
+
export interface AddressDataEN {
|
|
275
|
+
thana: string;
|
|
276
|
+
upazilla: string;
|
|
277
|
+
district: string;
|
|
278
|
+
division: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface AddressDataBN {
|
|
282
|
+
thana: string;
|
|
283
|
+
upazilla: string;
|
|
284
|
+
district: string;
|
|
285
|
+
division: string;
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
Each record represents a single thana and its parent upazila, district, and division.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Notes on Case Sensitivity
|
|
295
|
+
|
|
296
|
+
- All **English** lookup functions (`divisionalDataENOf`, `districtENOf`, `upazillasENOf`, `thanasENOf`) treat the input argument case‑insensitively.
|
|
297
|
+
- **Bangla** parameters should use the correct Bangla spelling; case does not apply in the same way.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Keywords
|
|
302
|
+
|
|
303
|
+
Bangladesh addresses, BD geo, division, district, upazila, thana, Bangla, English, Bangladeshi addresses, Bangladesh location data
|