Skip to main content

Complete Sunan Abi Dawud — 5,274 hadiths with full Arabic text and English translations. Offline-first, zero dependencies. CLI + Python library.

Project description

🕌 Sunan Abi Dawud

npm version npm downloads npm downloads per month license node version bundle size GitHub stars

📚 Complete Sunan Abi Dawud for JavaScript — CLI, Node.js, React, Vue, and every bundler. Tiny package, data served from CDN.

NPM


📊 Package Statistics

Metric Value Description
📚 Total Hadiths 5,274 Complete Sunan Abi Dawud collection
📝 Chapters 1,871 Detailed chapter organization
📦 Package Size ~3KB Core package — data loads from CDN
🔧 Dependencies 0 Zero external dependencies
🌐 Bilingual Full Arabic text + English translations
📘 TypeScript Built-in type definitions

🚀 Installation

npm install sunan-abi-dawud        # local
npm install -g sunan-abi-dawud     # global CLI

🖥️ CLI Usage

dawud 1                  # First hadith
dawud 2345               # Hadith #2345
dawud 23 34              # 34th hadith of chapter 23
dawud 2345 -a            # Arabic only
dawud 2345 -b            # Arabic + English
dawud --react            # Generate React hook in current project
dawud --help
dawud --version

⚛️ React / Vue / Vite

cd my-react-app
dawud --react
# ✓ Generated: src/hooks/useDawud.js
import { useDawud } from '../hooks/useDawud';

function HadithOfTheDay() {
  const dawud = useDawud();
  if (!dawud) return <p>Loading...</p>;

  const hadith = dawud.getRandom();
  return (
    <div>
      <p><strong>{hadith.english.narrator}</strong></p>
      <p>{hadith.english.text}</p>
    </div>
  );
}

🟩 Node.js Usage

// CommonJS
const dawud = require('sunan-abi-dawud');
console.log(dawud.get(1));
console.log(dawud.search('prayer'));
console.log(dawud.getRandom());
console.log(dawud.getByChapter(1));
console.log(dawud.length);

// ESM
import dawud from 'sunan-abi-dawud';
const hadith = dawud.get(23);
console.log(hadith.english.text);

🛠️ API Reference

Method / Property Description
dawud[0] Hadith at index 0
dawud.get(id) Hadith by ID
dawud.getByChapter(id) All hadiths in a chapter
dawud.search(query) Full-text search
dawud.getRandom() Random hadith
dawud.length Total hadiths
dawud.metadata Book metadata
dawud.chapters All chapters

All native array methods work: find, filter, map, forEach, slice.


📐 Data Structure

{
  "id": 1,
  "chapterId": 1,
  "arabic": "حَدَّثَنَا...",
  "english": {
    "narrator": "Abu Huraira",
    "text": "The Prophet (ﷺ) said..."
  }
}

📄 License

GNU Affero General Public License v3.0 (AGPL-3.0)


Made with ❤️ for the Muslim community | Seeking knowledge together

GitHub stars

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sunan_abi_dawud-1.0.4.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sunan_abi_dawud-1.0.4-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file sunan_abi_dawud-1.0.4.tar.gz.

File metadata

  • Download URL: sunan_abi_dawud-1.0.4.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for sunan_abi_dawud-1.0.4.tar.gz
Algorithm Hash digest
SHA256 87b12c18cd847a7f7b3a24b160ebb2786ac2980256bec2816160c2b06e02e41d
MD5 06c9b39b05d11a32ed85348b5ea772f2
BLAKE2b-256 c481f0ce73ae75a6e159f19ab43cb9a17954a6931163027bbbf57ab6c3163bf0

See more details on using hashes here.

File details

Details for the file sunan_abi_dawud-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sunan_abi_dawud-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e0c4760a319fd95867d2517ab028221e0bcf67e4309637dfca5cceb937f85c6f
MD5 aadd7125e0be858007a6c58f9592adf4
BLAKE2b-256 9a7aa3136a7f02e98ff4ea54d03a448a4bbb59e1ff0178984d988b025a1c18bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page