dz-wilayas-core 1.0.3 โ 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 -135
- 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 +4 -4
- package/lib/index.es.js +93 -33
- package/lib/store.d.ts +1 -7
- package/lib/types.d.ts +2 -2
- package/package.json +3 -3
- package/src/data/baladiyat-slim.json +7495 -3676
- package/src/data/wilayat-slim.json +384 -58
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,168 +1,68 @@
|
|
|
1
1
|
# dz-wilayas-core ๐ฉ๐ฟ
|
|
2
|
-

|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-

|
|
10
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/)
|
|
11
7
|
|
|
8
|
+
A lightweight TypeScript library providing Algeria's wilaya and baladiya data, with utilities for lookup and search in JavaScript and TypeScript projects.
|
|
12
9
|
|
|
13
|
-
**
|
|
10
|
+
**Current release:** `v1.1.0`
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## ๐ Table of Contents
|
|
18
|
-
|
|
19
|
-
- [Installation](#installation)
|
|
20
|
-
- [Usage](#usage)
|
|
21
|
-
- [API](#api)
|
|
22
|
-
- [Data](#data)
|
|
23
|
-
- [TypeScript Support](#typescript-support)
|
|
24
|
-
- [Contributing](#contributing)
|
|
25
|
-
- [Author](#author)
|
|
26
|
-
- [Credits](#credits)
|
|
27
|
-
- [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)
|
|
28
13
|
|
|
29
14
|
---
|
|
30
15
|
|
|
31
|
-
##
|
|
16
|
+
## Installation
|
|
32
17
|
|
|
33
18
|
```bash
|
|
34
19
|
npm install dz-wilayas-core
|
|
35
|
-
# or
|
|
36
|
-
yarn add dz-wilayas-core
|
|
37
20
|
```
|
|
38
21
|
|
|
39
|
-
|
|
22
|
+
Or with pnpm:
|
|
40
23
|
|
|
41
|
-
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add dz-wilayas-core
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
42
29
|
|
|
43
30
|
```ts
|
|
44
|
-
import { WilayasStore
|
|
31
|
+
import { WilayasStore } from "dz-wilayas-core";
|
|
45
32
|
|
|
46
33
|
const store = new WilayasStore();
|
|
47
34
|
|
|
48
35
|
// Get all wilayas
|
|
49
|
-
const
|
|
36
|
+
const wilayas = store.getAllWilayas();
|
|
50
37
|
|
|
51
|
-
//
|
|
52
|
-
const
|
|
38
|
+
// Find a wilaya by code
|
|
39
|
+
const alger = store.getWilayaByCode("16");
|
|
53
40
|
|
|
54
41
|
// Search wilayas by name
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
// Get all baladiyat for a wilaya
|
|
58
|
-
const algerBaladiyat: Baladiya[] = store.getBaladiyatByWilayaCode("16");
|
|
42
|
+
const results = store.searchWilayaByName("Oran");
|
|
59
43
|
|
|
60
|
-
|
|
44
|
+
// Get baladiyat for a wilaya
|
|
45
|
+
const baladiyat = store.getBaladiyatByWilayaCode("16");
|
|
61
46
|
```
|
|
62
47
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## ๐ API
|
|
66
|
-
|
|
67
|
-
### `class WilayasStore`
|
|
48
|
+
## Features
|
|
68
49
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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.
|
|
75
56
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## ๐ Data
|
|
79
|
-
|
|
80
|
-
- **Wilaya** object example:
|
|
81
|
-
|
|
82
|
-
```ts
|
|
83
|
-
interface Wilaya {
|
|
84
|
-
id: string;
|
|
85
|
-
code: string;
|
|
86
|
-
name: string;
|
|
87
|
-
ar_name: string;
|
|
88
|
-
}
|
|
89
|
-
```
|
|
57
|
+
For the complete API reference, data structure details, and usage examples, see the **[official documentation](https://dz-wilayas-core.netlify.app/#wilayas-store)**.
|
|
90
58
|
|
|
91
|
-
|
|
59
|
+
## Credits
|
|
92
60
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
id: string;
|
|
96
|
-
wilaya_id: string;
|
|
97
|
-
name: string;
|
|
98
|
-
ar_name: string;
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
All data is **preloaded from JSON** and typed for TypeScript.
|
|
103
|
-
|
|
104
|
-
---
|
|
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.
|
|
105
63
|
|
|
106
|
-
##
|
|
64
|
+
## License
|
|
107
65
|
|
|
108
|
-
|
|
109
|
-
- Provides `Wilaya` and `Baladiya` types.
|
|
110
|
-
- Includes `.d.ts` files for complete IDE autocompletion.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## ๐ค Contributing
|
|
115
|
-
|
|
116
|
-
1. Fork the repo
|
|
117
|
-
2. Create your branch (`git checkout -b feature/my-feature`)
|
|
118
|
-
3. Commit your changes (`git commit -am 'Add my feature'`)
|
|
119
|
-
4. Push to the branch (`git push origin feature/my-feature`)
|
|
120
|
-
5. Open a Pull Request
|
|
121
|
-
6. After your PR is merged, **uncomment the Contributors block below** and add yourself by replacing `<YourUsername>` with your GitHub username.
|
|
122
|
-
|
|
123
|
-
<!-- --- -->
|
|
124
|
-
|
|
125
|
-
<!--
|
|
126
|
-
## ๐ฅ Contributors
|
|
127
|
-
|
|
128
|
-
<table>
|
|
129
|
-
<tr>
|
|
130
|
-
<td align="center">
|
|
131
|
-
<a href="https://github.com/<YourUsername>">
|
|
132
|
-
<img src="https://avatars.githubusercontent.com/<YourUsername>" width="80px;" alt="<YourUsername>"/><br />
|
|
133
|
-
<sub><b><YourUsername></b></sub>
|
|
134
|
-
</a>
|
|
135
|
-
</td>
|
|
136
|
-
</tr>
|
|
137
|
-
</table> -->
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## ๐ค Author
|
|
143
|
-
|
|
144
|
-
<table>
|
|
145
|
-
<tr>
|
|
146
|
-
<td align="center">
|
|
147
|
-
<a href="https://github.com/ThaBugMaker">
|
|
148
|
-
<img src="https://avatars.githubusercontent.com/u/118787817?v=4" width="80px" style="border-radius:50%;" alt="ThaBugMaker"/><br>
|
|
149
|
-
<sub><b>ThaBugMaker</b></sub>
|
|
150
|
-
</a>
|
|
151
|
-
</td>
|
|
152
|
-
</tr>
|
|
153
|
-
</table>
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
## ๐ Credits
|
|
157
|
-
|
|
158
|
-
- **Data source:** [Wilaya-Of-Algeria](https://github.com/AbderrahmeneDZ/Wilaya-Of-Algeria) by [AbderrahmeneDZ](https://github.com/AbderrahmeneDZ) and [yamanidev](https://github.com/yamanidev)
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## ๐ License
|
|
163
|
-
|
|
164
|
-
This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.
|
|
165
|
-
|
|
166
|
-
---
|
|
66
|
+
MIT ยฉ 2025โ2026 [ThaBugMaker](https://github.com/ThaBugMaker)
|
|
167
67
|
|
|
168
|
-
|
|
68
|
+
See [LICENSE](./LICENSE) for details.
|