0.0.5 • Published 2 years ago

mv-prayertimes v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

mv-prayertimes

Prayer times for Maldives

This package uses a JSON replicate of the database used in the salatmv app. The source .db file can be found in the github repo.

Install

npm install mv-prayertimes

or

yarn install mv-prayertimes

Usage

import { MVPrayerTimes } from "mv-prayertimes";
// const { MVPrayerTimes } = require("mv-prayertimes");

const PrayerTimes = new MVPrayerTimes(102); // island id
const PrayerTimes = new MVPrayerTimes("K. Male"); // atoll and island
const PrayerTimes = new MVPrayerTimes("K", "Male"); // atoll and island

// get island id using
PrayerTimes.island.islandId; // 102

// prayer times for today
PrayerTimes.today; // [{call: 'fajr', ...}, ...]

// next prayer time
PrayerTimes.nextPrayer; // {call: 'fajr', timeInMinutes: 301, string: '' ...}

// events for every prayer time

PrayerTimes.on("prayer", (details) => {
  console.log(
    `[${details.string /* 5:30 */}] It's ${details.call /* fajr */} time!`
  );

  console.log(
    `Next prayer: ${PrayerTimes.nextPrayer.call /* dhuhr */} at ${
      PrayerTimes.nextPrayer.string /* 12:11 */
    }`
  );
});
0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago