dz-wilayas-core 1.0.2 โ 1.1.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/LICENSE +1 -1
- package/README.md +35 -83
- package/lib/data/baladiyat-slim.json.d.ts +9250 -0
- package/lib/data/baladiyat.d.ts +1 -7
- package/lib/data/wilayat-slim.json.d.ts +418 -0
- package/lib/data/wilayat.d.ts +1 -7
- package/lib/index.cjs.js +1 -6
- package/lib/index.d.ts +5 -5
- package/lib/index.es.js +93 -33
- package/lib/store.d.ts +1 -7
- package/lib/types.d.ts +3 -3
- package/package.json +3 -3
- package/src/data/baladiyat-slim.json +7496 -3671
- package/src/data/wilayat-slim.json +384 -58
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
# dz-wilayas-core
|
|
1
|
+
# dz-wilayas-core ๐ฉ๐ฟ
|
|
2
2
|
|
|
3
|
-
](https://www.npmjs.com/package/dz-wilayas-core)
|
|
4
|
+
[](https://www.npmjs.com/package/dz-wilayas-core)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
A lightweight TypeScript library providing Algeria's wilaya and baladiya data, with utilities for lookup and search in JavaScript and TypeScript projects.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Table of Contents
|
|
10
|
+
**Current release:** `v1.1.0`
|
|
10
11
|
|
|
11
|
-
- [
|
|
12
|
-
- [Usage](#usage)
|
|
13
|
-
- [API](#api)
|
|
14
|
-
- [Data](#data)
|
|
15
|
-
- [TypeScript Support](#typescript-support)
|
|
16
|
-
- [Contributing](#contributing)
|
|
17
|
-
- [License](#license)
|
|
12
|
+
๐ **[Official Documentation](https://dz-wilayas-core.netlify.app/#introduction)** ยท [npm Package](https://www.npmjs.com/package/dz-wilayas-core) ยท [GitHub Repository](https://github.com/ThaBugMaker/dz-wilayas-core)
|
|
18
13
|
|
|
19
14
|
---
|
|
20
15
|
|
|
@@ -22,95 +17,52 @@
|
|
|
22
17
|
|
|
23
18
|
```bash
|
|
24
19
|
npm install dz-wilayas-core
|
|
25
|
-
# or
|
|
26
|
-
yarn add dz-wilayas-core
|
|
27
20
|
```
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
Or with pnpm:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add dz-wilayas-core
|
|
26
|
+
```
|
|
30
27
|
|
|
31
|
-
##
|
|
28
|
+
## Quick Start
|
|
32
29
|
|
|
33
30
|
```ts
|
|
34
|
-
import { WilayasStore
|
|
31
|
+
import { WilayasStore } from "dz-wilayas-core";
|
|
35
32
|
|
|
36
33
|
const store = new WilayasStore();
|
|
37
34
|
|
|
38
35
|
// Get all wilayas
|
|
39
|
-
const
|
|
36
|
+
const wilayas = store.getAllWilayas();
|
|
40
37
|
|
|
41
|
-
//
|
|
42
|
-
const
|
|
38
|
+
// Find a wilaya by code
|
|
39
|
+
const alger = store.getWilayaByCode("16");
|
|
43
40
|
|
|
44
41
|
// Search wilayas by name
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
// Get all baladiyat for a wilaya
|
|
48
|
-
const algerBaladiyat: Baladiya[] = store.getBaladiyatByWilayaCode("16");
|
|
49
|
-
|
|
50
|
-
console.log(algerWilaya, algerBaladiyat);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## API
|
|
56
|
-
|
|
57
|
-
### `class WilayasStore`
|
|
58
|
-
|
|
59
|
-
| Method | Description |
|
|
60
|
-
| ---------------------------------------------------- | ------------------------------------------ |
|
|
61
|
-
| `getAllWilayas(): Wilaya[]` | Returns all wilayas. |
|
|
62
|
-
| `getWilayaByCode(code: string): Wilaya \| undefined` | Find a wilaya by its code. |
|
|
63
|
-
| `searchWilayaByName(name: string): Wilaya[]` | Search wilayas by name (case-insensitive). |
|
|
64
|
-
| `getBaladiyatByWilayaCode(code: string): Baladiya[]` | Get all baladiyat for a given wilaya code. |
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Data
|
|
42
|
+
const results = store.searchWilayaByName("Oran");
|
|
69
43
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```ts
|
|
73
|
-
interface Wilaya {
|
|
74
|
-
id: string;
|
|
75
|
-
code: string;
|
|
76
|
-
name: string;
|
|
77
|
-
ar_name: string;
|
|
78
|
-
}
|
|
44
|
+
// Get baladiyat for a wilaya
|
|
45
|
+
const baladiyat = store.getBaladiyatByWilayaCode("16");
|
|
79
46
|
```
|
|
80
47
|
|
|
81
|
-
|
|
48
|
+
## Features
|
|
82
49
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
```
|
|
50
|
+
- Algerian wilaya and baladiya datasets.
|
|
51
|
+
- Lookup wilayas by code.
|
|
52
|
+
- Search wilayas by name.
|
|
53
|
+
- Retrieve baladiyat by wilaya code.
|
|
54
|
+
- TypeScript declarations included.
|
|
55
|
+
- Works with JavaScript and TypeScript projects.
|
|
91
56
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
---
|
|
57
|
+
For the complete API reference, data structure details, and usage examples, see the **[official documentation](https://dz-wilayas-core.netlify.app/#wilayas-store)**.
|
|
95
58
|
|
|
96
|
-
##
|
|
59
|
+
## Credits
|
|
97
60
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
- Includes `.d.ts` files for complete IDE autocompletion.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Contributing
|
|
105
|
-
|
|
106
|
-
1. Fork the repo
|
|
107
|
-
2. Create your branch (`git checkout -b feature/my-feature`)
|
|
108
|
-
3. Commit your changes (`git commit -am 'Add my feature'`)
|
|
109
|
-
4. Push to the branch (`git push origin feature/my-feature`)
|
|
110
|
-
5. Open a Pull Request
|
|
111
|
-
|
|
112
|
-
---
|
|
61
|
+
- **Original data source:** [Wilaya-Of-Algeria](https://github.com/AbderrahmeneDZ/Wilaya-Of-Algeria) by [AbderrahmeneDZ](https://github.com/AbderrahmeneDZ) and [yamanidev](https://github.com/yamanidev).
|
|
62
|
+
- **2025โ2026 administrative update (69 wilayas):** [DZBuild โ Algeria's 69 Wilayas List](https://dzbuild.com/blog/algeria-69-wilayas-list-2025-2026), used as a reference for the CSV datasets.
|
|
113
63
|
|
|
114
64
|
## License
|
|
115
65
|
|
|
116
|
-
|
|
66
|
+
MIT ยฉ 2025โ2026 [ThaBugMaker](https://github.com/ThaBugMaker)
|
|
67
|
+
|
|
68
|
+
See [LICENSE](./LICENSE) for details.
|