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 🙏

© 2025 – Pkg Stats / Ryan Hefner

muwaqqit

v1.0.5

Published

A powerful and flexible TypeScript library for calculating Islamic prayer times based on location, with customizable settings.

Readme

Logo

Discord NPM License

Muwaqqit

Muwaqqit is a modern and flexible TypeScript library for fetching Islamic prayer times, full calendars, and Hijri/Gregorian date conversions — powered by the AlAdhan API.

🕌 Built with AlAdhan API
📅 Supports full-month and date-range calendars
🕰️ Works with city/country or GPS coordinates
🗓️ Converts between Gregorian ↔ Hijri

🔥 Features

  • 🌍 Fetch times by city/country or latitude/longitude
  • 🕰️ Retrieve daily prayer times
  • 📅 Retrieve monthly prayer calendar
  • 📆 Retrieve prayer times for a custom date range
  • 🗓️ Convert between Gregorian ↔ Hijri dates
  • 🧮 Choose from multiple calculation methods
  • ⏱️ Choose 12h / 24h / ISO time formats
  • 💡 Written in TypeScript — ready for Node.js, bots & web apps

📦 Installation

npm install muwaqqit

💡 Usage Example

TypeScript (ES Modules)

import { PrayerTimes } from 'muwaqqit';

const pt = new PrayerTimes({
  city: 'Cairo',
  country: 'Egypt',
  method: 5, // Egyptian General Authority of Survey
  format: '12h',
});

// 1️⃣ Today's prayer times
const today = await pt.getTimes(new Date());
console.table(today);

// 2️⃣ Full month calendar
const month = await pt.getMonth(10, 2025);
month.forEach(day => {
  console.log(`${day.date.readable} → Fajr: ${day.timings.Fajr}, Dhuhr: ${day.timings.Dhuhr}, Asr: ${day.timings.Asr}, Maghrib: ${day.timings.Maghrib}, Isha: ${day.timings.Isha}`);
});

// 3️⃣ Date range (1–7 Oct 2025)
const range = await pt.getRange('01-10-2025', '07-10-2025');
range.forEach(day => console.log(day.date.readable, day.timings));

// 4️⃣ Gregorian → Hijri
const hijri = await pt.toHijri('23-10-2025');
console.table(hijri);

// 5️⃣ Hijri → Gregorian
const gregorian = await pt.toGregorian('20-04-1447');
console.table(gregorian);

JavaScript (CommonJS)

const { PrayerTimes } = require('muwaqqit');

const pt = new PrayerTimes({
  city: 'Cairo',
  country: 'Egypt',
  method: 5,
  format: '24h',
});

(async () => {
  const times = await pt.getTimes(new Date());
  console.log("Today's Prayer Times:", times);
})();

🧠 API Reference

new PrayerTimes(options)

| Option | Type | Required | Description | | ----------- | ----------------------------- | -------- | ------------------------------------------------ | | city | string | ✅ | City name (required if not using latitude) | | country | string | ✅ | Country name (required if not using latitude) | | latitude | number | ✅ | Decimal latitude (required if not using city) | | longitude | number | ✅ | Decimal longitude (required if not using city) | | method | number | ❌ | Calculation method (default = 2) | | format | "12h" | "24h" | "iso" | ❌ | Output time format (default = "24h") | | timezone | string | ❌ | Optional timezone override |


🧩 Methods

| Method | Description | | --------------------------------------- | ------------------------------------------------------------------------------- | | getTimes(date: Date) | Get daily prayer times for a specific date | | getMonth(month: number, year: number) | Get full calendar for a month | | getRange(start: string, end: string) | Get prayer times for a custom date range (e.g., "01-10-2025", "07-10-2025") | | toHijri(date: string) | Convert Gregorian date to Hijri | | toGregorian(date: string) | Convert Hijri date to Gregorian |


🛠️ Calculation Methods

Based on AlAdhan API:

| ID | Method | | --- | --------------------------------------------- | | 0 | Shia Ithna-Ashari | | 1 | University of Islamic Sciences, Karachi | | 2 | Islamic Society of North America | | 3 | Muslim World League | | 4 | Umm Al-Qura University, Makkah | | 5 | Egyptian General Authority of Survey | | 7 | Institute of Geophysics, University of Tehran | | 12 | Union Organization Islamic de France | | ... | (see full list on AlAdhan API docs) |


📬 Feedback & Support


📘 License

This project is licensed under the Apache-2.0 License — see the LICENSE file for details.