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 🙏

© 2024 – Pkg Stats / Ryan Hefner

praytimess

v2.3.3

Published

A library for calculating prayer times.

Downloads

11

Readme

PrayTimess

A JavaScript library for calculating prayer times based on location, timezone and date. This library helps you get the prayer timings for various locations around the world.

Installation

You can install the praytimess library via npm:

npm install praytimess

Example Usage

// Import the library
const PrayTimes = require('praytimess');

// Create an instance of PrayTimess
const prayTimes = new PrayTimes();

// Set the calculation method (e.g., Egyptian General Authority of Survey)
prayTimes.setMethod('Egypt');

// Define the location and date
const latitude = 30.0444;  // Cairo, Egypt
const longitude = 31.2357; // Cairo, Egypt
const timezone = +2;       // GMT+2 for Cairo
const dst = 1;             // Daylight Saving Time (0 = no, 1 = yes)
const timeformat = '24h';     // 24-hour format

// Get prayer times
const times = prayTimes.getTimes(new Date(), [latitude, longitude], timezone, dst, timeformat);

console.log("Prayer Times:");
console.log(`Imsak: ${times.imsak}`);
console.log(`Fajr: ${times.fajr}`);
console.log(`Sunrise: ${times.sunrise}`);
console.log(`Dhuhr: ${times.dhuhr}`);
console.log(`Asr: ${times.asr}`);
console.log(`Sunset: ${times.sunset}`);
console.log(`Maghrib: ${times.maghrib}`);
console.log(`Isha: ${times.isha}`);
console.log(`Midnight: ${times.midnight}`);

Time Formats

Here are the available time formats: | Format | Description | Example | |--------|--------------------------------|----------| | 24h | 24-hour time format | 16:45 | | 12h | 12-hour time format | 4:45 pm | | 12hNS | 12-hour format with no suffix | 4:45 | | Float | Floating point number | 16.75 |

Calculation Methods

Set the calculation method using the setMethod function. Here are available methods: | Method | Description | |---------|-----------------------------------------------| | MWL | Muslim World League | | ISNA | Islamic Society of North America | | Egypt | Egyptian General Authority of Survey | | Makkah | Umm al-Qura University, Makkah | | Karachi | University of Islamic Sciences, Karachi | | Tehran | Institute of Geophysics, University of Tehran | | Jafari | Shia Ithna Ashari (Ja`fari) |

Source Acknowledgment

Source: PrayTimes.org by Hamid Zarrabi-Zadeh.

License

This project is licensed under the ISC License.

Key Components of the README

  • Library Overview: A brief introduction to what the library does.
  • Installation Instructions: A command for installing the library using npm.
  • Example Usage: A code example demonstrating how to use the library effectively, including how to define the location and get prayer times.
  • Source Acknowledgment: Credit to the source of the calculations.

Feel free to customize any part of it to better fit your project or add any additional information!