nepal-places 0.2.2 → 0.3.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 +53 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# nepal-places
|
|
2
|
+
|
|
3
|
+
Zero-dependency data package for Nepal's geographical divisions. Provinces, Districts, Municipalities, Wards, and Places — with bilingual (Nepali/English) names.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install nepal-places
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { getProvinces, getDistricts, getMunicipalities, getWards, getPlaces } from 'nepal-places'
|
|
13
|
+
|
|
14
|
+
// All provinces
|
|
15
|
+
getProvinces()
|
|
16
|
+
// → [{ id: 1, name: 'Koshi', name_np: 'कोशी प्रदेश' }, ...]
|
|
17
|
+
|
|
18
|
+
// Districts in a province
|
|
19
|
+
getDistricts(1)
|
|
20
|
+
|
|
21
|
+
// Municipalities in a district
|
|
22
|
+
getMunicipalities(14)
|
|
23
|
+
|
|
24
|
+
// Wards in a municipality
|
|
25
|
+
getWards(178)
|
|
26
|
+
|
|
27
|
+
// Places in a ward
|
|
28
|
+
getPlaces(1)
|
|
29
|
+
|
|
30
|
+
// Full hierarchy from a code
|
|
31
|
+
getHierarchy({ code: '3/14/178/1' })
|
|
32
|
+
// → { province: {...}, district: {...}, municipality: {...}, ward: {...}, places: [...] }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Data structure
|
|
36
|
+
|
|
37
|
+
| Level | Count | Nepali names |
|
|
38
|
+
|-------|-------|-------------|
|
|
39
|
+
| Province | 7 | 7/7 (100%) |
|
|
40
|
+
| District | 77 | 77/77 (100%) |
|
|
41
|
+
| Municipality | 753 | 753/753 (100%) |
|
|
42
|
+
| Ward | 6,741 | 753/753 municipalities |
|
|
43
|
+
| Place | 10,000+ | Collecting |
|
|
44
|
+
|
|
45
|
+
Places data is being collected ward by ward and is partially complete.
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
See the [full documentation](https://github.com/kushal1o1/NepalPlaces).
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT — [kushal1o1](https://github.com/kushal1o1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nepal-places",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Zero-dependency Nepal geographical data — Provinces, Districts, Municipalities, Wards. Works with React, Node.js, any JS framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"files": ["dist"],
|
|
15
|
+
"files": ["dist", "README.md"],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsc",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|