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.0.3

Published

Type-safe JavaScript and TypeScript SDK for the Al-Quran Database REST and GraphQL APIs.

Readme

@faha1999/al-quran-database

Type-safe JavaScript and TypeScript SDK for the Al-Quran Database REST and GraphQL APIs.

Install

npm install @faha1999/al-quran-database

Usage

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

const quran = new QuranDevSDK({
  baseUrl: 'http://localhost:3000',
  apiVersion: 'v1',
});

const surah = await quran.getSurah(1, 'en.sahih');
console.log(surah.name_en);
console.log(surah.ayahs[0]?.translation);

const { data: duas } = await quran.getDuas(1, 5);
const { data: reciters } = await quran.getReciters();
console.log(duas[0]?.text);
console.log(reciters[0]?.name);

Self-hosted production usage:

const quran = new QuranDevSDK({
  baseUrl: 'https://your-domain.example',
});

Same-origin usage:

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

const ayah = await quran.getAyah(1, 'en.sahih', true);
console.log(ayah.words?.[0]?.text);

Default behavior

  • baseUrl defaults to same-origin, which is useful inside browser apps deployed alongside the API.
  • apiVersion defaults to v1.
  • The package ships as ESM only and targets Node.js 18+ environments with native fetch.
  • REST helpers throw on non-2xx responses and unsuccessful API envelopes.
  • GraphQL helper throws on HTTP failures or GraphQL errors.

Exports

  • QuranDevSDK
  • quran
  • QuranApiOptions
  • GraphqlRequest
  • MetaPayload
  • Public entity and response types from the API schema

API coverage

  • Surahs, ayahs, pages, juz, hizb, rub
  • Search with edition or language filters
  • Words, duas, reciters, FAQs, knowledge entries, metadata
  • GraphQL requests

Public methods:

  • 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 quran.graphql<{
  meta: { dataset: { counts: { ayahs: number } } };
}>({
  query: `
    query Meta {
      meta {
        dataset {
          counts {
            ayahs
          }
        }
      }
    }
  `,
});

console.log(data.meta.dataset.counts.ayahs);

Source of truth

  • Published package source: packages/sdk
  • Runtime surface is verified in repo tests and npm run verify:sdk

Links