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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@faha1999/al-quran-database

v2.2.0

Published

Complete Quran dataset with TypeScript SDK — works offline with no server. Includes REST & GraphQL SDK, 134 translations, word-by-word data, scholarly knowledge base, and SQL exports.

Readme

@faha1999/al-quran-database

npm version npm downloads License

Complete Quran dataset with TypeScript SDK — works offline with no server required. Includes 134 translations, word-by-word data, a scholarly knowledge base, and a REST + GraphQL SDK.

Install

npm install @faha1999/al-quran-database

Zero-setup usage (offline, no server)

import { getSurah, getAyah, searchAyahs } from '@faha1999/al-quran-database';

// Works immediately — no running server, no network, no .env file
const fatiha = getSurah(1);
// → { id: 1, name_en: 'Al-Faatiha', ayahs: [...7 ayahs with translations...] }

const ayah = getAyah(1, 'en.sahih');
// → { text: 'بِسْمِ ٱللَّهِ ...', translation: 'In the name of Allah...' }

const results = searchAyahs('mercy');
// → { items: [...], meta: { total: 50, page: 1, ... } }

Bundled editions (available offline)

import { BUNDLED_EDITION_IDENTIFIERS } from '@faha1999/al-quran-database';
// → ['en.sahih', 'quran-simple-clean', 'en.yusufali', 'quran-uthmani']

const surah = getSurah(2, 'quran-uthmani');   // full Uthmani Arabic
const surah = getSurah(2, 'en.sahih');        // Sahih International English

All 134 other editions are available via CDN or the self-hosted REST API.

Local data functions reference

import {
  // Surahs
  getSurah, getAllSurahs,
  // Ayahs
  getAyah, getAyahByNumber,
  // Divisions
  getJuzById, getHizbById, getRubById, getPageById,
  getJuzs, getHizbs, getRubs, getPages,
  // Editions
  getAllEditions, getTextEditions, getEditionByIdentifier,
  // Content
  getReciters, getDuas,
  // Knowledge base
  getKnowledgeByAyah, getSurahProfile, getKnowledgeFaqs, getKnowledgeCoverage,
  // Research
  getResearchReferences,
  // Meta
  getDatasetMetadata, getSupportedLanguagesList,
  // Search
  searchAyahs,
  // Raw data arrays
  surahs, ayahs, editions, juzs, hizbs, rubs, pages, reciters, duas,
  knowledgeBase, datasetMetadata, extraContext,
  // Utilities
  BUNDLED_EDITION_IDENTIFIERS, DEFAULT_TRANSLATION_IDENTIFIER,
  paginate, loadEditionContent,
} from '@faha1999/al-quran-database';

CDN access (no install needed)

All bundled files are available on jsDelivr instantly after publish:

https://cdn.jsdelivr.net/gh/faha1999/[email protected]/lib/data/surahs.json
https://cdn.jsdelivr.net/gh/faha1999/[email protected]/lib/data/ayahs.json
https://cdn.jsdelivr.net/gh/faha1999/[email protected]/lib/data/ayah-editions/en.sahih.json

Self-hosted REST + GraphQL API

For all 134 editions or advanced features, run the full platform:

import { QuranDevSDK } from '@faha1999/al-quran-database';

const sdk = new QuranDevSDK({ baseUrl: 'http://localhost:3000' });
const surah = await sdk.getSurah(2, 'ur.maududi'); // any of 134 editions
const hits = await sdk.search('mercy', { language: 'en' });

QuranDevSDK API

  • getSurahs(page?, limit?)
  • getSurah(id, edition?)
  • getAyah(id, edition?, includeWords?)
  • search(query, filters?)
  • getJuz(id, edition?)
  • getHizb(id, edition?)
  • getRub(id, edition?)
  • getPage(id, edition?)
  • getWords(ayahId)
  • getDuas(page?, limit?)
  • getReciters()
  • getFaqs()
  • getKnowledge(ayahId)
  • getMeta()
  • getResearchReferences()
  • graphql({ query, variables? })

GraphQL example

const data = await sdk.graphql<{
  meta: { dataset: { counts: { ayahs: number } } };
}>({
  query: `query Meta { meta { dataset { counts { ayahs } } } }`,
});
console.log(data.meta.dataset.counts.ayahs); // → 6236

Default behavior

  • Local functions work with zero config — data is bundled in the package.
  • QuranDevSDK baseUrl defaults to same-origin (for browser apps deployed alongside the API).
  • apiVersion defaults to v1.
  • Package is ESM-only, targets Node.js 18+.
  • REST helpers throw on non-2xx or unsuccessful API envelopes.

Links