npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

algeria-locations

v1.0.6

Published

🇩🇿 A complete list of Algerian wilayas, dairas, and communes with helper functions.

Downloads

442

Readme

🇩🇿 Algeria Locations

A lightweight JavaScript library that provides complete data for Wilayas, Dairas, and Communes of Algeria — with easy search and filtering utilities.

Now fully updated to support the new 69 Wilayas administrative division alignment! 🇩🇿✨

Perfect for form builders, location selectors, or projects that need structured Algerian administrative data.


🚀 Installation

npm install algeria-locations

or using Yarn:

yarn add algeria-locations

🧩 Usage

import {
  wilayas,
  dairas,
  communes,
  getWilayaByCode,
  getDairaByCode,
  getCommuneByCode,
  searchWilayaNames,
  searchDairaNames,
  searchCommuneNames,
  filterCommunesByWilaya,
  filterDairasByWilaya
} from "algeria-locations";

// Example: get a wilaya by its code
const algiers = getWilayaByCode("16");
console.log(algiers.name); // "Alger"

// Example: find all communes of a wilaya
// Works with new wilayas too! (e.g. "59" for El Meniaa)
const algiersCommunes = filterCommunesByWilaya("16");

// Example: search wilayas by name
const matches = searchWilayaNames("Or");

📦 Exports

Data Arrays

  • wilayas → List of all 69 wilayas (including the 10 newly created wilayas)
  • dairas → List of all dairas with their wilaya_id
  • communes → List of all communes with their daira_id

Utility Functions

| Function | Description | | ------------------------------------ | -------------------------------------------------- | | getWilayaByCode(code) | Returns a wilaya object by its code | | getDairaByCode(code) | Returns a daira object by its code | | getCommuneByCode(code) | Returns a commune object by its code | | searchWilayaNames(query) | Search wilayas by name (FR/AR, accent-insensitive) | | searchDairaNames(query) | Search dairas by name | | searchCommuneNames(query) | Search communes by name | | filterCommunesByWilaya(wilayaCode) | Get all communes of a wilaya | | filterDairasByWilaya(wilayaCode) | Get all dairas of a wilaya |


🌟 New Feature: 69 Wilayas Alignment

This library has been updated to align with the latest Algerian administrative division (Loi n° 19-12), bringing the total to 69 Wilayas.

It includes the 10 new wilayas promoted from delegated wilayas: Timimoun, Bordj Badji Mokhtar, Ouled Djellal, Béni Abbès, In Salah, In Guezzam, Touggourt, Djanet, El M'Ghair, and El Meniaa.

All data associations (Dairas and Communes) have been realigned to their correct new parent Wilayas.


🗂️ Data Structure Example

[
  { id: 1, code: "1", name: "Adrar", name_ar: "أدرار" },

🧠 Notes

  • All codes are stored as strings (e.g. "01031", not 1031).
  • Search is accent- and case-insensitive, and supports both French and Arabic.
  • No external dependencies — pure JavaScript.

🛠️ Build

If you want to build the library locally:

npm run build

(Requires Vite which is already included in devDependencies.)


📜 License

MIT © 2025 Mohammed Abdelhak


💡 Contributing

Pull requests are welcome! If you spot an issue or have an idea for improvement, open an issue on GitHub.

Bsahtek ya mowaطin , Build something Great !