sunnah 1.1.4 β†’ 1.2.1

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.

Files changed (3) hide show
  1. package/README.md +158 -111
  2. package/bin/index.js +978 -204
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,14 +2,16 @@
2
2
 
3
3
  <h1>πŸ“Ώ Sunnah</h1>
4
4
 
5
- ![npm version](https://img.shields.io/badge/npm-coming%20soon-orange?style=for-the-badge&logo=npm)
6
- ![license](https://img.shields.io/badge/license-AGPL--3.0-blue?style=for-the-badge&logo=gnu)
7
- ![status](https://img.shields.io/badge/status-in%20development-yellow?style=for-the-badge)
5
+ ![npm version](https://img.shields.io/npm/v/sunnah?style=for-the-badge&logo=npm)
6
+ ![npm downloads](https://img.shields.io/npm/dt/sunnah?style=for-the-badge&logo=npm)
7
+ ![npm downloads per month](https://img.shields.io/npm/dm/sunnah?style=for-the-badge&logo=npm)
8
+ ![license](https://img.shields.io/github/license/SENODROOM/sunnah?style=for-the-badge&logo=gnu)
9
+ ![node version](https://img.shields.io/node/v/sunnah?style=for-the-badge&logo=node.js)
8
10
  ![GitHub stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github)
9
11
 
10
- **πŸ“š One package. Every major Hadith collection. CLI, Node.js, React, Vue β€” all supported.**
12
+ **πŸ“š One command. Every major Hadith collection. Interactive CLI installer for the entire Sunnah ecosystem.**
11
13
 
12
- _Coming soon to npm_
14
+ [![NPM](https://nodei.co/npm/sunnah.png)](https://nodei.co/npm/sunnah/)
13
15
 
14
16
  </div>
15
17
 
@@ -17,166 +19,210 @@ _Coming soon to npm_
17
19
 
18
20
  ## πŸŒ™ What is Sunnah?
19
21
 
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.
22
+ `sunnah` is an interactive CLI package manager for the major hadith collections of Islam. Install, manage, and update every book in the Sunnah ecosystem from a single terminal UI β€” with real-time progress bars, keyboard navigation, and zero config.
21
23
 
22
- ---
24
+ ```bash
25
+ npm install -g sunnah
26
+ sunnah
27
+ ```
23
28
 
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 |
29
+ That's it. A beautiful full-screen terminal UI opens, showing every available hadith package β€” select what you want, press enter, watch it install.
38
30
 
39
31
  ---
40
32
 
41
- ## πŸš€ Planned API
33
+ ## πŸ“¦ Available Packages
42
34
 
43
- ### Install a specific book
35
+ | Book | Package | Hadiths | Author | CLI Command |
36
+ | -------------------- | ---------------------------------------------------------------- | ------- | ---------------- | ----------- |
37
+ | **Sahih al-Bukhari** | [`sahih-al-bukhari`](https://npmjs.com/package/sahih-al-bukhari) | 7,563 | Imam al-Bukhari | `bukhari` |
38
+ | **Sahih Muslim** | [`sahih-muslim`](https://npmjs.com/package/sahih-muslim) | 7,470 | Imam Muslim | `muslim` |
39
+ | **Sunan Abi Dawud** | [`sunan-abi-dawud`](https://npmjs.com/package/sunan-abi-dawud) | 5,274 | Imam Abu Dawud | `dawud` |
40
+ | **Jami al-Tirmidhi** | [`jami-al-tirmidhi`](https://npmjs.com/package/jami-al-tirmidhi) | 3,956 | Imam al-Tirmidhi | `tirmidhi` |
44
41
 
45
- ```bash
46
- # Install the full package
47
- npm install sunnah
42
+ ---
48
43
 
49
- # Or install globally for CLI access
44
+ ## πŸš€ Installation
45
+
46
+ ```bash
50
47
  npm install -g sunnah
51
48
  ```
52
49
 
53
- ### CLI β€” download and browse any book
50
+ ---
54
51
 
55
- ```bash
56
- # Download a hadith book
57
- sunnah download bukhari
58
- sunnah download muslim
59
- sunnah download tirmidhi
52
+ ## πŸ–₯️ Usage
60
53
 
61
- # Browse hadiths
62
- sunnah bukhari 1
63
- sunnah muslim 2345 --arabic
64
- sunnah tirmidhi 23 34 --both
54
+ ### Interactive UI (default)
65
55
 
66
- # List all available books
67
- sunnah list
56
+ ```bash
57
+ sunnah
58
+ ```
59
+
60
+ Opens a full-screen interactive installer:
68
61
 
69
- # Show help
70
- sunnah --help
62
+ ```
63
+ ══════════════════════════════════════════════════════════════════════
64
+ πŸ“š Sunnah Package Manager v1.1.2
65
+ ↑↓ navigate space select a all i info u uninstall enter install q quit
66
+ ══════════════════════════════════════════════════════════════════════
67
+
68
+ β–Ά [βœ“] Sahih al-Bukhari ● installed
69
+ Imam Muhammad ibn Ismail al-Bukhari
70
+ The most authentic collection of hadith...
71
+ Hadiths: 7,563 CLI: bukhari --help
72
+
73
+ [ ] Sahih Muslim β—‹ not installed
74
+ [ ] Sunan Abi Dawud β—‹ not installed
75
+ [ ] Jami al-Tirmidhi β—‹ not installed
76
+
77
+ ──────────────────────────────────────────────────────────────────────
78
+ ● 1 selected: sahih-al-bukhari
79
+ ──────────────────────────────────────────────────────────────────────
71
80
  ```
72
81
 
73
- ### Node.js
82
+ ### Keyboard Controls
74
83
 
75
- ```javascript
76
- import { bukhari, muslim, tirmidhi } from "sunnah";
84
+ | Key | Action |
85
+ | ------- | ------------------------------------- |
86
+ | `↑` `↓` | Navigate packages |
87
+ | `space` | Toggle select |
88
+ | `a` | Select all / deselect all |
89
+ | `i` | Show package info + installed version |
90
+ | `u` | Uninstall selected |
91
+ | `enter` | Install selected |
92
+ | `q` | Quit |
77
93
 
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));
94
+ ### Non-interactive commands
83
95
 
84
- // Or import all books at once
85
- import sunnah from "sunnah";
86
- sunnah.bukhari.get(1);
87
- sunnah.muslim.get(1);
96
+ ```bash
97
+ sunnah --list # List all packages with install status
98
+ sunnah --update # Check all installed packages for updates
99
+ sunnah --help # Show help
100
+ sunnah --version # Show version
88
101
  ```
89
102
 
90
- ### React β€” one command setup
103
+ ---
104
+
105
+ ## πŸ“Ί Install Flow
106
+
107
+ When you press `enter`, each package installs with a live animated progress bar:
91
108
 
92
- ```bash
93
- # Inside your React project
94
- sunnah --react
95
109
  ```
110
+ ══════════════════════════════════════════════════════════════════════
111
+ Installing 2 packages…
112
+ ══════════════════════════════════════════════════════════════════════
113
+
114
+ [1/2] Sahih al-Bukhari
115
+ npm install -g sahih-al-bukhari
116
+
117
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 50% Downloading tarball…
96
118
 
97
- Generates hooks for every book:
119
+ βœ“ Sahih al-Bukhari installed
120
+ Usage: bukhari --help
98
121
 
99
- ```jsx
100
- import { useBukhari, useMuslim, useTirmidhi } from "../hooks/useSunnah";
122
+ [2/2] Jami al-Tirmidhi
123
+ npm install -g jami-al-tirmidhi
101
124
 
102
- function HadithComponent() {
103
- const bukhari = useBukhari();
104
- const muslim = useMuslim();
125
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% Complete!
105
126
 
106
- if (!bukhari || !muslim) return <p>Loading...</p>;
127
+ βœ“ Jami al-Tirmidhi installed
128
+ Usage: tirmidhi --help
107
129
 
108
- return (
109
- <div>
110
- <p>{bukhari.getRandom().english.text}</p>
111
- <p>{muslim.getRandom().english.text}</p>
112
- </div>
113
- );
114
- }
130
+ ══════════════════════════════════════════════════════════════════════
131
+ βœ“ All done! 2 packages installed globally.
132
+
133
+ β–Έ bukhari --help Β· Sahih al-Bukhari
134
+ β–Έ tirmidhi --help Β· Jami al-Tirmidhi
135
+ ══════════════════════════════════════════════════════════════════════
115
136
  ```
116
137
 
117
138
  ---
118
139
 
119
- ## πŸ”§ Planned Features
140
+ ## πŸ” --list
120
141
 
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
142
+ ```bash
143
+ sunnah --list
144
+ ```
145
+
146
+ ```
147
+ ────────────────────────────────────────────────────────────
148
+ Available Sunnah Packages
149
+ ────────────────────────────────────────────────────────────
150
+
151
+ Sahih al-Bukhari βœ“ installed
152
+ npm install -g sahih-al-bukhari
153
+ The most authentic collection of hadith...
154
+ Hadiths: 7,563 Author: Imam Muhammad ibn Ismail al-Bukhari
155
+
156
+ Sahih Muslim βœ— not installed
157
+ npm install -g sahih-muslim
158
+ ...
159
+ ```
130
160
 
131
161
  ---
132
162
 
133
- ## πŸ—ΊοΈ Roadmap
163
+ ## πŸ”„ --update
164
+
165
+ ```bash
166
+ sunnah --update
167
+ ```
168
+
169
+ Checks every installed package against the latest version on npm:
134
170
 
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
171
+ ```
172
+ ────────────────────────────────────────────────────────────
173
+ Checking for updates…
174
+ ────────────────────────────────────────────────────────────
175
+
176
+ βœ“ Sahih al-Bukhari 1.2.0 β€” up to date
177
+ ↑ Jami al-Tirmidhi 1.0.1 β†’ 1.1.0 (run: npm install -g jami-al-tirmidhi)
178
+ ```
141
179
 
142
180
  ---
143
181
 
144
- ## πŸ“¦ Current Package
182
+ ## πŸ—‚οΈ After Installing
145
183
 
146
- If you need Sahih al-Bukhari right now, it is already available as a standalone package:
184
+ Once you've installed individual packages via `sunnah`, each has its own powerful CLI:
147
185
 
148
186
  ```bash
149
- npm install sahih-al-bukhari
150
- npm install -g sahih-al-bukhari
151
- ```
187
+ # Read hadiths
188
+ bukhari 1 # First hadith
189
+ muslim 2345 -b # Hadith #2345 in Arabic + English
190
+ tirmidhi 23 34 # 34th hadith of chapter 23
191
+ dawud --random # Random hadith
192
+
193
+ # Search
194
+ bukhari --search "prayer" # Top 5 results with highlighted matches
195
+ tirmidhi --search "fasting" --all # All results
152
196
 
153
- [![sahih-al-bukhari on npm](https://img.shields.io/npm/v/sahih-al-bukhari?style=for-the-badge&logo=npm&label=sahih-al-bukhari)](https://www.npmjs.com/package/sahih-al-bukhari)
197
+ # Browse chapters
198
+ muslim --chapter 5 # All hadiths in chapter 5
154
199
 
155
- Full documentation β†’ [sahih-al-bukhari README](https://github.com/SENODROOM/sahih-al-bukhari)
200
+ # React hook
201
+ bukhari --react # Generate useBukhari() hook in your project
202
+ ```
156
203
 
157
204
  ---
158
205
 
159
- ## πŸ”” Stay Updated
206
+ ## πŸ”— Individual Package Links
160
207
 
161
- Watch this repository to get notified when `sunnah` launches on npm.
208
+ Each book is also available as a standalone package with full Node.js, React, and Vue support:
162
209
 
163
- [![GitHub stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github)](https://github.com/SENODROOM/sunnah)
164
- [![GitHub watchers](https://img.shields.io/github/watchers/SENODROOM/sunnah?style=for-the-badge&logo=github)](https://github.com/SENODROOM/sunnah)
210
+ | Package | npm | GitHub |
211
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
212
+ | `sahih-al-bukhari` | [![npm](https://img.shields.io/npm/v/sahih-al-bukhari?style=flat-square&logo=npm)](https://npmjs.com/package/sahih-al-bukhari) | [SENODROOM/sahih-al-bukhari](https://github.com/SENODROOM/sahih-al-bukhari) |
213
+ | `sahih-muslim` | [![npm](https://img.shields.io/npm/v/sahih-muslim?style=flat-square&logo=npm)](https://npmjs.com/package/sahih-muslim) | [SENODROOM/sahih-muslim](https://github.com/SENODROOM/sahih-muslim) |
214
+ | `sunan-abi-dawud` | [![npm](https://img.shields.io/npm/v/sunan-abi-dawud?style=flat-square&logo=npm)](https://npmjs.com/package/sunan-abi-dawud) | [SENODROOM/sunan-abi-dawud](https://github.com/SENODROOM/sunan-abi-dawud) |
215
+ | `jami-al-tirmidhi` | [![npm](https://img.shields.io/npm/v/jami-al-tirmidhi?style=flat-square&logo=npm)](https://npmjs.com/package/jami-al-tirmidhi) | [SENODROOM/jami-al-tirmidhi](https://github.com/SENODROOM/jami-al-tirmidhi) |
165
216
 
166
217
  ---
167
218
 
168
219
  ## 🀝 Contributing
169
220
 
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
221
+ Contributions are welcome!
176
222
 
177
223
  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'`
224
+ 2. Create a branch: `git checkout -b feature/my-feature`
225
+ 3. Commit: `git commit -m 'Add my feature'`
180
226
  4. Push and open a Pull Request
181
227
 
182
228
  ---
@@ -199,9 +245,10 @@ Licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** β€” see
199
245
 
200
246
  **Made with ❀️ for the Muslim community | Seeking knowledge together**
201
247
 
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)
248
+ [![GitHub stars](https://img.shields.io/github/stars/SENODROOM/sunnah?style=for-the-badge&logo=github)](https://github.com/SENODROOM/sunnah)
249
+
250
+ [πŸ“¦ npm](https://npmjs.com/package/sunnah) β€’
251
+ [πŸ› Issues](https://github.com/SENODROOM/sunnah/issues) β€’
252
+ [🀝 Contribute](https://github.com/SENODROOM/sunnah/pulls)
206
253
 
207
254
  </div>