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

quran-pack

v1.0.0

Published

Quran package is sourced from the website of the Ministry of Religion of the Republic of Indonesia.

Downloads

80

Readme

Quran-pack

Quran package is sourced from the website of the Ministry of Religion of the Republic of Indonesia.

Installation

Install package using npm.

npm i quran-pack

Features

Quick Start

Import package

Import the package into your js/ts file with default import:

import * as Quran from 'quran-pack';

Import the package into your js/ts file with named import:

import { Surah } from 'quran-pack';

Declaration instance

const quran = Quran.surah('Al-Fatihah');
// or
const quran1 = Quran.surah(1);

or

const quran = new Surah('Al-Fatihah');
// or
const quran1 = new Surah(1);

Accessing property:

//...
quran.surahNumber; // 1
quran.name; // الفاتحة
quran.nameLatin; // Al-Fātiḥah
quran.nameID; // Al-Fatihah
quran.nameTranslateID; // Pembuka
quran.category; // Makkiyah
quran.numberOfVerse; // 7
quran.isMakkiyah; // true
quran.isMadaniyah; // false
quran.arabics; // object
quran.latins; // object
quran.translations; // object
quran.tafsirs; // object

Surah list

Quran.surahList; // list of surah

Use the provided methods:

const quran = Quran.surah('Al-Fatihah');
const verse = quran.getVerse(5); // return object surah al-fatihah verse 5.
const verses = quran.getVerses(1, 3); // return object surah alfatihah from verse 1 until verse 3, because the limit are 3 verses.

Result Quran.surah('Al-Fatihah').getVerse(5);, its mean Al-Fatihah verse 5.

{
  arabic: 'اِيَّاكَ نَعْبُدُ وَاِيَّاكَ نَسْتَعِيْنُۗ',
  latin: "Iyyāka na'budu wa iyyāka nasta'īn(u),",
  translation: {
    id: 'Hanya kepada Engkaulah kami menyembah ...'
  },
  tafsir: {
    id: {
      kemenag: 'Atas dasar itu semua, ...'
    }
  }
}

Result Quran.surah('Al-Fatihah').getVerses(1, 3);, its mean Al-Fatihah verses 1 - 3.

{
  hasPrev: false,
  hasNext: true,
  arabics: {
    '1': 'بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيْمِ',
    '2': 'اَلْحَمْدُ لِلّٰهِ رَبِّ الْعٰلَمِيْنَۙ',
    '3': 'الرَّحْمٰنِ الرَّحِيْمِۙ'
  },
  latins: {
    '1': 'Bismillāhir-raḥmānir-raḥīm(i).',
    '2': "Al-ḥamdu lillāhi rabbil-'ālamīn(a).",
    '3': 'Ar-raḥmānir-raḥīm(i).'
  },
  translations: {
    id: {
      '1': 'Dengan nama Allah Yang Maha Pengasih lagi Maha Penyayang.',
      '2': 'Segala puji bagi Allah, Tuhan1) semesta alam',
      '3': 'Yang Maha Pengasih lagi Maha Penyayang,'
    }
  },
  tafsirs: {
    id: {
      kemenag: {
        '1': "Aku memulai bacaan Al-Qur'an ...",
        '2': "Segala puji kita persembahkan hanya untuk Allah semata ...",
        '3': "Dialah Yang Maha Pengasih, ...",
      }
    }
  }
}

Result Quran.surahList.

[
  {
    number: 1,
    name: 'الفاتحة',
    name_latin: 'Al-Fātiḥah',
    name_id: 'Al-Fatihah',
    name_trans_id: 'Pembuka',
    number_of_verse: 7,
    category: 'Makkiyah',
  },
  {
    number: 2,
    name: 'البقرة',
    name_latin: 'Al-Baqarah',
    name_id: 'Al-Baqarah',
    name_trans_id: 'Sapi',
    number_of_verse: 286,
    category: 'Madaniyah',
  },
  ...
];

Extensible Surah class

The Surah class is supports extensible that allow you to add additional methods or functions.

import { Surah } from 'quran-pack';

class MySurah extends Surah {
  constructor(value) {
    super(value);
    // ...
  }

  theMethod() {
    // ...
  }

  anotherMethod() {
    // ...
  }
}

const quran = new MySurah(1);
quran.theMethod(); // output
quran.anotherMethod(); // output