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

@prayerzone/prayer-times

v0.1.1

Published

Official JavaScript and TypeScript SDK for the pray.zone prayer-times API.

Readme

PrayerZone JavaScript SDK

PrayerZone JavaScript SDK

CI npm MIT License

The official, typed JavaScript and TypeScript client for the public PrayerZone prayer-times API.

Use it in Node.js, modern browsers, serverless functions, React, Vue, Svelte, Next.js, Nuxt, and other JavaScript runtimes with the Fetch API.

Features

  • Complete TypeScript types
  • City and mosque prayer schedules
  • Nearby mosque discovery
  • Qibla and calculation metadata
  • Eight supported languages
  • Request timeout and automatic retries
  • In-memory cache and concurrent request deduplication
  • Structured, actionable errors
  • No runtime dependencies
  • ESM and CommonJS builds

Installation

npm install @prayerzone/prayer-times

Node.js 18 or later is required. Modern browsers work without a polyfill.

Quick start

import { PrayerZone } from "@prayerzone/prayer-times";

const prayerZone = new PrayerZone();

const schedule = await prayerZone.getCityPrayerTimes("paris", {
  language: "fr",
});

console.log(schedule.city.name);
console.table(schedule.data.prayerTimes);
console.log(`Qibla: ${schedule.data.qibla.bearing}°`);

Mosque schedules

const schedule = await prayerZone.getMosquePrayerTimes(
  "paris_grande-mosquee-de-paris",
  { language: "fr" },
);

console.log(schedule.mosque.title);
console.table(schedule.data.prayerTimes);

Find nearby mosques

const mosques = await prayerZone.getNearbyMosques({
  longitude: 2.3522,
  latitude: 48.8566,
  maxDistance: 5_000,
});

for (const mosque of mosques) {
  console.log(mosque.title, mosque.distance);
}

Configuration

const prayerZone = new PrayerZone({
  timeoutMs: 8_000,
  retries: 2,
  retryDelayMs: 250,
  cacheTtlMs: 5 * 60_000,
  headers: {
    "X-Application": "my-prayer-app",
  },
});

| Option | Default | Description | |---|---:|---| | baseUrl | https://pray.zone | API origin; useful for tests or proxies | | fetch | globalThis.fetch | Custom Fetch API implementation | | timeoutMs | 10000 | Timeout for each request attempt | | retries | 2 | Retries for network, timeout, 408, 429, and 5xx errors | | retryDelayMs | 250 | Initial exponential retry delay | | cacheTtlMs | 300000 | Successful response cache duration; 0 disables it | | headers | — | Additional HTTP request headers |

Call prayerZone.clearCache() whenever an application needs a forced refresh.

Error handling

import { PrayerZoneError } from "@prayerzone/prayer-times";

try {
  await prayerZone.getCityPrayerTimes("unknown-city");
} catch (error) {
  if (error instanceof PrayerZoneError) {
    console.error(error.code, error.status, error.message);
  }
}

Possible codes are API_ERROR, NETWORK_ERROR, TIMEOUT, and VALIDATION_ERROR. The retryable property identifies temporary failures.

Languages

The language option accepts:

ar, bn, de, en, es, fr, it, pt

English (en) is used by default.

API and examples

Localized PrayerZone websites

pray.zone is the canonical project and developer domain. PrayerZone also provides localized prayer-time websites:

Development

npm install
npm run validate

See CONTRIBUTING.md for the contribution workflow.

Attribution

Attribution is appreciated:

Prayer times powered by [PrayerZone](https://pray.zone/)

License

MIT