{"id":17350309,"url":"https://github.com/aqeelshamz/hadith-db","last_synced_at":"2026-05-03T04:39:52.053Z","repository":{"id":257815300,"uuid":"869471711","full_name":"aqeelshamz/hadith-db","owner":"aqeelshamz","description":"JavaScript Library for Hadith","archived":false,"fork":false,"pushed_at":"2024-10-08T16:48:56.000Z","size":13419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T16:48:26.005Z","etag":null,"topics":["hadith","javascript","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aqeelshamz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-08T11:00:02.000Z","updated_at":"2024-10-09T04:54:08.000Z","dependencies_parsed_at":"2024-10-15T17:06:25.241Z","dependency_job_id":null,"html_url":"https://github.com/aqeelshamz/hadith-db","commit_stats":null,"previous_names":["anuragpoolakkal/hadith","aqeelshamz/hadith-db"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqeelshamz%2Fhadith-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqeelshamz%2Fhadith-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqeelshamz%2Fhadith-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aqeelshamz%2Fhadith-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aqeelshamz","download_url":"https://codeload.github.com/aqeelshamz/hadith-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841760,"owners_count":20681196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hadith","javascript","npm"],"created_at":"2024-10-15T17:06:27.879Z","updated_at":"2026-05-03T04:39:52.026Z","avatar_url":"https://github.com/aqeelshamz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm package](https://img.shields.io/npm/v/hadith.svg)](https://www.npmjs.com/package/hadith)\n\n# Hadith\n\nThis JavaScript package provides access to Hadith data offline.\n\nAvailable Hadith data:\n\n-   Bukhari\n-   Muslim\n-   Abu Dawud\n-   Tirmidhi\n-   Nasai\n-   Ibn Majah\n\nHadith data is taken from sunnah.com.\n\n## Getting Started\n\nTo use this package, install `hadith` by running:\n\n```bash\nnpm install hadith\n```\n\n## Functions\n\n### Collections:\n\n-   **`getCollections()`** - Returns a list of available Hadith collections.\n-   **`getCollection(Collections collection)`** - Takes a [collection] as an argument and returns a [Collection] object.\n-   **`getCollectionData(Collections collection, Languages language)`** - Takes [collection] and [language] as arguments and returns a [CollectionData] object.\n\n### Books:\n\n-   **`getBooks(Collections collection)`** - Takes a [collection] as an argument and returns a list of [Book] objects.\n-   **`getBook(Collections collection, int bookNumber)`** - Takes [collection] and [bookNumber] as arguments and returns a [Book] object.\n-   **`getBookData(Collections collection, int bookNumber, Languages language)`** - Takes [collection], [bookNumber], and [language] as arguments and returns a [BookData] object.\n\n### Hadiths:\n\n-   **`getHadiths(Collections collection, int bookNumber)`** - Takes [collection] and [bookNumber] as arguments and returns a list of [Hadith] objects.\n-   **`getHadith(Collections collection, int bookNumber, int hadithNumber)`** - Takes [collection], [bookNumber], and [hadithNumber] as arguments and returns a [Hadith] object.\n-   **`getHadithByNumber(Collections collection, String hadithNumber)`** - Takes [collection] and [hadithNumber] as arguments and returns a [Hadith] object.\n-   **`getHadithData(Collections collection, int bookNumber, int hadithNumber, Languages language)`** - Takes [collection], [bookNumber], [hadithNumber], and [language] as arguments and returns a [HadithData] object.\n-   **`getHadithDataByNumber(Collections collection, String hadithNumber, Languages language)`** - Takes [collection], [hadithNumber], and [language] as arguments and returns a [HadithData] object.\n\n### URLs:\n\n-   **`getCollectionURL(Collections collection)`** - Takes [collection] as an argument and returns the URL (from sunnah.com) of that collection.\n-   **`getBookURL(Collections collection, int bookNumber)`** - Takes [collection] and [bookNumber] as arguments and returns the URL (from sunnah.com) of that book.\n\n## Examples\n\n### Collections:\n\n**Get available collections:**\n```javascript\nimport { getCollections } from \"hadith\";\n\nconsole.log(getCollections());\n```\n\n**Get a single collection:**\n```javascript\nimport { getCollection, Collections } from 'hadith';\n\nconsole.log(getCollection(Collections.BUKHARI));\n```\n\n**Get collection data:**\n```javascript\nimport { getCollectionData, Collections, Languages } from 'hadith';\n\nconsole.log(getCollectionData(Collections.BUKHARI, Languages.EN));\n```\n\n### Books:\n**Get books of a collection:**\n```javascript\nimport { getBooks, Collections } from 'hadith';\n\nconsole.log(getBooks(Collections.BUKHARI));\n```\n\n**Get a single book:**\n```javascript\nimport { getBook, Collections } from 'hadith';\n\nconsole.log(getBook(Collections.BUKHARI, 1));\n```\n\n**Get book data:**\n```javascript\nCopy code\nimport { getBookData, Collections, Languages } from 'hadith';\n\nconsole.log(getBookData(Collections.BUKHARI, 1, Languages.EN));\n```\n\n### Hadiths:\n**Get hadiths of a book:**\n```javascript\nimport { getHadiths, Collections } from 'hadith';\n\nconsole.log(getHadiths(Collections.BUKHARI, 1));\n```\n\n**Get a single hadith:**\n```javascript\nimport { getHadith, Collections } from 'hadith';\n\nconsole.log(getHadith(Collections.BUKHARI, 1, 1));\n```\n\n**Get hadith data:**\n```javascript\nimport { getHadithData, Collections, Languages } from 'hadith';\n\nconsole.log(getHadithData(Collections.BUKHARI, 1, 1, Languages.EN));\n```\n\n**Get hadith data by hadith number:**\n```javascript\nimport { getHadithDataByNumber, Collections, Languages } from 'hadith';\n\nconsole.log(getHadithDataByNumber(Collections.BUKHARI, '1', Languages.EN));\n```\n\n### URLs:\n**Get collection URL:**\n```javascript\nimport { getCollectionURL, Collections } from 'hadith';\n\nconsole.log(getCollectionURL(Collections.BUKHARI));\n```\n**Get book URL:**\n```javascript\nimport { getBookURL, Collections } from 'hadith';\n\nconsole.log(getBookURL(Collections.BUKHARI, 1));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faqeelshamz%2Fhadith-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faqeelshamz%2Fhadith-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faqeelshamz%2Fhadith-db/lists"}