No description
Find a file
2024-10-22 21:21:13 -03:00
etc Emit dist/index.mjs 2024-10-22 19:44:19 -03:00
share/Quran docs: add / fix examples 2024-10-22 21:13:43 -03:00
src Update src/index.ts 2024-10-22 09:02:51 -03:00
.editorconfig First commit 2024-10-22 02:02:04 -03:00
.gitignore Update .gitignore 2024-10-22 08:49:48 -03:00
package.json docs: add / fix examples 2024-10-22 21:13:43 -03:00
README.md docs: update 2024-10-22 21:21:13 -03:00

About

This repository provides a programmer's interface to The Noble Quran, alongside various translations.

Examples

Quran.locales

The Quran.locales method provides an object where the key is a locale name (such as en) and the value is a locale object. The locales returned by this method indicate what languages the @0x1eef/Quran library supports:

#!/usr/bin/env node
import { Quran } from "@0x1eef/Quran";

(() => {
  const locales = Object.keys(Quran.locales);
  locales.forEach((key) => {
    const locale = Quran.locales[key];
    console.log("The Noble Quran for ", locale.displayName, " speakers");
  });
  /*
    The Noble Quran for English speakers
    The Noble Quran for العربية speakers
    The Noble Quran for فارسی speakers
  */
})();

Quran.surahs

The Quran.surahs method provides an object where the key is a locale name (such as en) and the value is a surah object. For example:

#!/usr/bin/env node
import { Quran } from "@0x1eef/Quran";

(() => {
  const surah = Quran.surahs["en"][0];
  const ayah = surah.ayat[0].body;
  console.log(ayah);
  /*
     In the Name of Allah —
     the Most Compassionate, Most Merciful.
   */
})();

Languages

  • Arabic
  • English
  • Farsi

Install

FIXME: haven't published to npm yet

@0x1eef/Quran is available via npm:

npm i @0x1eef/Quran

Thanks

الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ

Thanks to the translators: - English (The Clear Quran) by Dr. Mustafa Khattab - Farsi by Hussain Ansarian

Sources

License

The "source code" is released under the terms of the GPL
See LICENSE for details