sunnah 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sunnah might be problematic. Click here for more details.
- package/README.md +207 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<h1>πΏ Sunnah</h1>
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
**π One package. Every major Hadith collection. CLI, Node.js, React, Vue β all supported.**
|
|
11
|
+
|
|
12
|
+
_Coming soon to npm_
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## π What is Sunnah?
|
|
19
|
+
|
|
20
|
+
`sunnah` is an upcoming npm package that gives developers programmatic access to the major hadith collections of Islam β in one unified, consistent API. Whether you're building a web app, a mobile app, a CLI tool, or a backend API, `sunnah` will be the single source for all authentic hadith literature.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## π Planned Hadith Collections
|
|
25
|
+
|
|
26
|
+
| Book | Author | Hadiths | Status |
|
|
27
|
+
| --------------------- | --------------- | ------- | --------------------------------------------------------------------------------- |
|
|
28
|
+
| **Sahih al-Bukhari** | Imam al-Bukhari | 7,277 | β
Available ([sahih-al-bukhari](https://www.npmjs.com/package/sahih-al-bukhari)) |
|
|
29
|
+
| **Sahih Muslim** | Imam Muslim | 7,563 | π Coming Soon |
|
|
30
|
+
| **Sunan Abu Dawud** | Abu Dawud | 5,274 | π Coming Soon |
|
|
31
|
+
| **Jami at-Tirmidhi** | Imam Tirmidhi | 3,956 | π Coming Soon |
|
|
32
|
+
| **Sunan an-Nasa'i** | Imam an-Nasa'i | 5,758 | π Coming Soon |
|
|
33
|
+
| **Sunan Ibn Majah** | Ibn Majah | 4,341 | π Coming Soon |
|
|
34
|
+
| **Muwatta Malik** | Imam Malik | 1,832 | π Coming Soon |
|
|
35
|
+
| **Musnad Ahmad** | Imam Ahmad | 27,000+ | π Coming Soon |
|
|
36
|
+
| **Riyad as-Salihin** | Imam an-Nawawi | 1,896 | π Coming Soon |
|
|
37
|
+
| **Al-Adab Al-Mufrad** | Imam al-Bukhari | 1,322 | π Coming Soon |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## π Planned API
|
|
42
|
+
|
|
43
|
+
### Install a specific book
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Install the full package
|
|
47
|
+
npm install sunnah
|
|
48
|
+
|
|
49
|
+
# Or install globally for CLI access
|
|
50
|
+
npm install -g sunnah
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### CLI β download and browse any book
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Download a hadith book
|
|
57
|
+
sunnah download bukhari
|
|
58
|
+
sunnah download muslim
|
|
59
|
+
sunnah download tirmidhi
|
|
60
|
+
|
|
61
|
+
# Browse hadiths
|
|
62
|
+
sunnah bukhari 1
|
|
63
|
+
sunnah muslim 2345 --arabic
|
|
64
|
+
sunnah tirmidhi 23 34 --both
|
|
65
|
+
|
|
66
|
+
# List all available books
|
|
67
|
+
sunnah list
|
|
68
|
+
|
|
69
|
+
# Show help
|
|
70
|
+
sunnah --help
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Node.js
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import { bukhari, muslim, tirmidhi } from "sunnah";
|
|
77
|
+
|
|
78
|
+
// Each book has the same consistent API
|
|
79
|
+
console.log(bukhari.get(1));
|
|
80
|
+
console.log(muslim.search("prayer"));
|
|
81
|
+
console.log(tirmidhi.getRandom());
|
|
82
|
+
console.log(tirmidhi.getByChapter(3));
|
|
83
|
+
|
|
84
|
+
// Or import all books at once
|
|
85
|
+
import sunnah from "sunnah";
|
|
86
|
+
sunnah.bukhari.get(1);
|
|
87
|
+
sunnah.muslim.get(1);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### React β one command setup
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Inside your React project
|
|
94
|
+
sunnah --react
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Generates hooks for every book:
|
|
98
|
+
|
|
99
|
+
```jsx
|
|
100
|
+
import { useBukhari, useMuslim, useTirmidhi } from "../hooks/useSunnah";
|
|
101
|
+
|
|
102
|
+
function HadithComponent() {
|
|
103
|
+
const bukhari = useBukhari();
|
|
104
|
+
const muslim = useMuslim();
|
|
105
|
+
|
|
106
|
+
if (!bukhari || !muslim) return <p>Loading...</p>;
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div>
|
|
110
|
+
<p>{bukhari.getRandom().english.text}</p>
|
|
111
|
+
<p>{muslim.getRandom().english.text}</p>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## π§ Planned Features
|
|
120
|
+
|
|
121
|
+
- π¦ **One package** β all major hadith collections in a single install
|
|
122
|
+
- β‘ **Tiny install** β data loads from CDN, not bundled into your app
|
|
123
|
+
- π **Bilingual** β Arabic text + English translation for every collection
|
|
124
|
+
- π **Unified search** β search across a single book or all books at once
|
|
125
|
+
- π₯οΈ **CLI** β read any hadith from your terminal
|
|
126
|
+
- βοΈ **React/Vue hooks** β auto-generated with one command
|
|
127
|
+
- π **TypeScript** β full type definitions
|
|
128
|
+
- π§ **Zero dependencies** β no external packages required
|
|
129
|
+
- π **Universal** β Node.js CJS, Node.js ESM, React, Vue, Vite, webpack
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## πΊοΈ Roadmap
|
|
134
|
+
|
|
135
|
+
- [x] **v1.0** β Sahih al-Bukhari released as standalone package
|
|
136
|
+
- [ ] **v2.0** β Sahih Muslim added
|
|
137
|
+
- [ ] **v2.5** β Abu Dawud, Tirmidhi, Nasa'i, Ibn Majah added (the Six Books)
|
|
138
|
+
- [ ] **v3.0** β Muwatta Malik, Musnad Ahmad, Riyad as-Salihin added
|
|
139
|
+
- [ ] **v4.0** β Cross-book search, shared narrator index, topic tagging
|
|
140
|
+
- [ ] **v5.0** β Full sunnah.com-style grading and chain of narration data
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## π¦ Current Package
|
|
145
|
+
|
|
146
|
+
If you need Sahih al-Bukhari right now, it is already available as a standalone package:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npm install sahih-al-bukhari
|
|
150
|
+
npm install -g sahih-al-bukhari
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
[](https://www.npmjs.com/package/sahih-al-bukhari)
|
|
154
|
+
|
|
155
|
+
Full documentation β [sahih-al-bukhari README](https://github.com/SENODROOM/sahih-al-bukhari)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## π Stay Updated
|
|
160
|
+
|
|
161
|
+
Watch this repository to get notified when `sunnah` launches on npm.
|
|
162
|
+
|
|
163
|
+
[](https://github.com/SENODROOM/sunnah)
|
|
164
|
+
[](https://github.com/SENODROOM/sunnah)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## π€ Contributing
|
|
169
|
+
|
|
170
|
+
Want to help build this? Contributions are very welcome.
|
|
171
|
+
|
|
172
|
+
- π **Data** β Help format and verify hadith collections
|
|
173
|
+
- π» **Code** β Build the package infrastructure
|
|
174
|
+
- π **Docs** β Write documentation and examples
|
|
175
|
+
- π **Issues** β Report bugs or suggest features
|
|
176
|
+
|
|
177
|
+
1. Fork the repository
|
|
178
|
+
2. Create a branch: `git checkout -b feature/muslim-collection`
|
|
179
|
+
3. Commit: `git commit -m 'Add Sahih Muslim data'`
|
|
180
|
+
4. Push and open a Pull Request
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## π License
|
|
185
|
+
|
|
186
|
+
Licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** β see [LICENSE](LICENSE) for details.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## π Acknowledgments
|
|
191
|
+
|
|
192
|
+
- **π Sources** β The authentic hadith collections of Islam
|
|
193
|
+
- **π¨βπ« Scholars** β Translators and Islamic scholars whose work makes this possible
|
|
194
|
+
- **π Community** β The Muslim developer community worldwide
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
<div align="center">
|
|
199
|
+
|
|
200
|
+
**Made with β€οΈ for the Muslim community | Seeking knowledge together**
|
|
201
|
+
|
|
202
|
+
[π Current Package](https://www.npmjs.com/package/sahih-al-bukhari) β’
|
|
203
|
+
[π Roadmap](#οΈ-roadmap) β’
|
|
204
|
+
[π€ Contribute](#-contributing) β’
|
|
205
|
+
[π Watch for Updates](https://github.com/SENODROOM/sunnah)
|
|
206
|
+
|
|
207
|
+
</div>
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sunnah",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "One package. Every major Hadith collection. CLI, Node.js, React, Vue β all supported",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/SENODROOM/sunnah.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/SENODROOM/sunnah/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/SENODROOM/sunnah#readme"
|
|
20
|
+
}
|