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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 ThaBugMaker
3
+ Copyright (c) 2025 - 2026 ThaBugMaker
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,20 +1,15 @@
1
- # dz-wilayas-core
1
+ # dz-wilayas-core ๐Ÿ‡ฉ๐Ÿ‡ฟ
2
2
 
3
- ![npm](https://img.shields.io/npm/v/dz-wilayas-core?color=blue) ![license](https://img.shields.io/npm/l/dz-wilayas-core) ![downloads](https://img.shields.io/npm/dt/dz-wilayas-core)
3
+ [![npm version](https://img.shields.io/npm/v/dz-wilayas-core)](https://www.npmjs.com/package/dz-wilayas-core)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dz-wilayas-core)](https://www.npmjs.com/package/dz-wilayas-core)
5
+ [![License](https://img.shields.io/npm/l/dz-wilayas-core)](./LICENSE)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
4
7
 
5
- **A TypeScript library providing Algeria's wilayas and baladiyat data with utility classes for easy lookup, search, and integration in any JavaScript or TypeScript project.**
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
- - [Installation](#installation)
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
- ## Usage
28
+ ## Quick Start
32
29
 
33
30
  ```ts
34
- import { WilayasStore, Wilaya, Baladiya } from "dz-wilayas-core";
31
+ import { WilayasStore } from "dz-wilayas-core";
35
32
 
36
33
  const store = new WilayasStore();
37
34
 
38
35
  // Get all wilayas
39
- const allWilayas: Wilaya[] = store.getAllWilayas();
36
+ const wilayas = store.getAllWilayas();
40
37
 
41
- // Get a wilaya by code
42
- const algerWilaya = store.getWilayaByCode("16");
38
+ // Find a wilaya by code
39
+ const alger = store.getWilayaByCode("16");
43
40
 
44
41
  // Search wilayas by name
45
- const searchResults = store.searchWilayaByName("Oran");
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
- - **Wilaya** object example:
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
- - **Baladiya** object example:
48
+ ## Features
82
49
 
83
- ```ts
84
- interface Baladiya {
85
- id: string;
86
- wilaya_id: string;
87
- name: string;
88
- ar_name: string;
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
- All data is **preloaded from JSON** and typed for TypeScript.
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
- ## TypeScript Support
59
+ ## Credits
97
60
 
98
- - Fully **typed** out-of-the-box.
99
- - Provides `Wilaya` and `Baladiya` types.
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
- This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.
66
+ MIT ยฉ 2025โ€“2026 [ThaBugMaker](https://github.com/ThaBugMaker)
67
+
68
+ See [LICENSE](./LICENSE) for details.