quran-meta
    Preparing search index...

    Function getSurahName

    • Returns the name of one Surah from a names table, falling back to English when the table has no entry for it.

      Only the table you pass ends up in your bundle: English and Arabic come with the main entry, the other languages from quran-meta/i18n or getSurahNamesAsync.

      Parameters

      Returns SurahName

      [name, translation], e.g. ["Al-Baqara", "The Cow"]. For Arabic it is [name with tashkeel, name without tashkeel].

      RangeError If the surah number is not between 1 and 114

      import { getSurahName, surahNamesAr } from "quran-meta"
      import { surahNamesFr } from "quran-meta/i18n"

      getSurahName(2) // ["Al-Baqara", "The Cow"]
      getSurahName(2, surahNamesAr) // ["البَقَرَة", "البقرة"]
      getSurahName(2, surahNamesFr) // ["Al Baqarah", "La vache"]