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

hizbs-warsh-dataset

v1.0.1

Published

A lightweight dataset of the Qur’an Hizb divisions, available in multiple formats (JSON, XML, CSV, and SQL). This package provides the 60 hizbs of the Qur’an with both top-down and bottom-up numbering, making it easy to integrate into Islamic apps, educat

Readme

Hizbs Warsh Dataset

License: MIT

Important Disclaimer

  • This project does not provide tafsir (interpretation) or religious rulings of the Qur'an. The dataset is intended strictly as a technical resource.
  • The author is not a religious scholar; the author is a computer science specialist.
  • Use this dataset as a data/tooling resource for software development, research, and educational applications; do not rely on it as a religious or jurisprudential reference.

Overview

Hizbs Warsh Dataset is a structured dataset of the 60 hizb divisions of the Qur'an. It is provided in multiple export formats and includes metadata designed to make integration into applications, research pipelines, and educational tools straightforward.

Features

  • Complete dataset of all 60 hizbs.
  • Multiple formats: JSON, XML, SQL.
  • Dual numbering support: up-to-down and down-to-top.
  • Implementations / helper APIs for JavaScript/Node.js and PHP.
  • Rich metadata per hizb: name, start/end surah, ayah indices, descriptions.
  • Utility scripts for export generation and data validation.

Installation

Node.js / JavaScript (npm)

npm install hizbs-warsh-dataset

PHP (Composer)

composer require redadevcraft/quran-hizb-data

Usage

JavaScript / Node.js

const {
  getAllHizbs,
  getHizbById,
  getHizbByOrderUp,
  getHizbByOrderDown,
} = require("hizbs-warsh-dataset");

// Get all hizbs
const allHizbs = getAllHizbs();

// Get specific hizb by ID (1-60)
const hizb = getHizbById(1);

// Get hizb by order (up-to-down)
const hizbByOrder = getHizbByOrderUp(30);

// Get hizb by order (down-to-top)
const hizbByOrderDown = getHizbByOrderDown(15);

PHP

<?php
require_once 'vendor/autoload.php';

use QuranData\HisbProvider;

// Get all hizbs
$allHizbs = HisbProvider::getAllHizbs();

// Get specific hizb by ID
$hizb = HisbProvider::getHizbById(1);

// Get hizb by order (up-to-down)
$hizbByOrder = HisbProvider::getHizbByOrderUpToDown(30);

// Get hizb by order (down-to-top)
$hizbByOrderDown = HisbProvider::getHizbByOrderDownToTop(15);

Data Structure

Each hizb entry is represented as an object with the following fields. Ayah fields may be represented as numeric indices or as text depending on the export format.

{
  "id": 1,
  "name": "سبح - الأعلى",
  "start_surah": "الأعلى",
  "start_ayah": "سسَبِّحِ اِ۪سْمَ رَبِّكَ اَ۬لَاعْلَي",
  "end_surah": "الناس",
  "end_ayah": "مِنَ اَ۬لْجِنَّةِ وَالنَّاسِۖ",
  "order_up_to_down": 60,
  "order_down_to_top": 1,
  "description": "الحزب الستون من القرآن الكريم، يبدأ من سورة الأعلى ويمتد إلى نهاية القرآن بسورة الناس، ويشمل السور القصيرة في الجزء الأخير"
}

API Reference

JavaScript API

  • getAllHizbs(): Return all 60 hizbs.
  • getHizbById(id): Return a hizb by its ID (1–60).
  • getHizbByOrderUp(order): Return hizb by up-to-down order.
  • getHizbByOrderDown(order): Return hizb by down-to-top order.
  • listAll(): Alias for getAllHizbs().

PHP API

Core Methods

  • HisbProvider::getAllHizbs(): Get all 60 hizbs.
  • HisbProvider::getHizbById(int $id): Get hizb by ID (1–60).
  • HisbProvider::getHizbByOrderUpToDown(int $order): Get hizb by top-down order.
  • HisbProvider::getHizbByOrderDownToTop(int $order): Get hizb by bottom-up order.

Search Methods

  • HisbProvider::getHizbsBySurah(string $surahName): Find hizbs containing a specific surah.
  • HisbProvider::searchHizbsByName(string $name, bool $exactMatch = false): Search by hizb name.
  • HisbProvider::getHizbsInRange(int $startOrder, int $endOrder): Get hizbs in order range.

Utility Methods

  • HisbProvider::getHizbCount(): Return 60.
  • HisbProvider::getRandomHizb(): Randomly select a hizb.
  • HisbProvider::isValidHizbId(int $id): Validate ID.
  • HisbProvider::isValidHizbOrder(int $order): Validate order.

Export Methods

  • HisbProvider::toJson(?int $hizbId = null): Export to JSON (optionally a single hizb).
  • HisbProvider::toXml(): Export full dataset to XML.

Available Formats

All dataset exports are stored in the data/ directory.

  • JSON: data/hizbs.json
  • XML: data/hizbs.xml
  • SQL: data/hizbs.sql
  • Full Qur'an SQL (Athman): data/full_coran/quran_athman.sql

Examples

Example scripts and usage samples:

  • examples/javascript-node/example.js — Node.js examples.
  • examples/php/example.php — PHP examples.
  • examples/php/README.md — Detailed PHP documentation.

Scripts

Utility scripts included in the repository:

  • scripts/generate_sql.js — Generate SQL from JSON.
  • scripts/generate_xml.js — Generate XML from JSON.
  • scripts/validate.js — Validate dataset integrity.

Testing

PHP Tests

php tests/HisbProviderTest.php

Run tests to validate PHP provider functionality and data integrity.

Hizb Numbering System

  1. Up-to-Down (order_up_to_down): Traditional numbering from 1 to 60, starting at the beginning of the Qur'an.
  2. Down-to-Top (order_down_to_top): Reverse numbering from 1 to 60, starting from the end of the Qur'an.

Requirements

Node.js

  • Node.js >= 12.0.0

PHP

  • PHP >= 7.4
  • JSON extension (standard)
  • SimpleXML extension (for XML export)

Contributing

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/your-feature.
  3. Commit your changes: git commit -m "Describe your changes".
  4. Push the branch: git push origin feature/your-feature.
  5. Open a Pull Request describing your changes and rationale.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Taleb Mohammed Reda

External Resources

Useful repositories and datasets that complement this project:

Acknowledgments

  • The Qur'an text and structure as preserved by the scholarly tradition.
  • Open-source projects and contributors that made data integration and tooling possible.
  • Contributors who help maintain and improve this dataset.

Changelog

Version 1.0.0

  • Initial release with complete 60 hizbs dataset.
  • JavaScript/Node.js package implementation.
  • PHP/Composer package implementation.
  • Exports in JSON, XML, and SQL.
  • Test suites and documentation.