cloudku-murotal

1.0.1 • Public • Published

🕌 Murotal API Client

Node.js NPM JavaScript TypeScript MIT License

Modern Islamic API Client - Simple, Fast, Reliable

Created by AlfiDev

📦 Install🚀 Quick Start📖 Documentation💡 Examples


🌟 Features

🕌 Prayer Times 📖 Al-Quran 🤲 Dua & Hadith 📅 Calendar
Jadwal sholat akurat Surah & Ayat lengkap Koleksi doa harian Kalender Hijriah
Multi-kota Indonesia Audio murotal Hadist Bukhari Konversi tanggal
Update real-time Terjemahan & tafsir Hadist Arbain Event Islam

📦 Installation

npm install cloudku-murotal
yarn add cloudku-murotal

🚀 Quick Start

import MurotalAPI from 'cloudku-murotal';
const api = new MurotalAPI();

const prayer = await api.getPrayerTimes('1', '2024-01-01');
const ayah = await api.getRandomAyah();
const doa = await api.getRandomDoa();
📋 Click to see response examples
{
  jadwal: {
    tanggal: '2024-01-01',
    imsak: '04:30',
    subuh: '04:40',
    terbit: '06:05',
    dhuha: '06:30',
    dzuhur: '12:10',
    ashar: '15:25',
    maghrib: '18:15',
    isya: '19:30'
  }
}

🎯 Usage Methods

🔧 ES Modules (Recommended)

import MurotalAPI from 'cloudku-murotal';
const api = new MurotalAPI();

📦 CommonJS

const { MurotalAPI } = require('cloudku-murotal');
const api = new MurotalAPI();

🌐 Browser

<script type="module">
import MurotalAPI from './node_modules/cloudku-murotal/index.mjs';
const api = new MurotalAPI();
</script>

📖 API Reference

🕌 Prayer Times & Location

Method Parameters Description
getCities() - 📍 List semua kota Indonesia
searchCities(query) string 🔍 Cari kota berdasarkan nama
getPrayerTimes(id, date) string, string ⏰ Jadwal sholat harian
getPrayerTimesByMonth(id, month, year) string, number, number 📅 Jadwal sholat bulanan

📅 Islamic Calendar

Method Parameters Description
getTodayHijriDate() - 📆 Tanggal Hijriah hari ini
getHijriDate(date) string 🔄 Konversi Masehi ke Hijriah

🌟 Asmaul Husna

Method Parameters Description
getAllHusna() - 📜 99 Asmaul Husna lengkap
getRandomHusna() - 🎲 Asmaul Husna acak
getHusnaByNumber(id) number 🔢 Berdasarkan urutan 1-99

📖 Holy Quran

Method Parameters Description
getSurahList() - 📋 114 Surah Al-Quran
getSurahByNumber(id) number 📖 Surah berdasarkan nomor
getRandomSurah() - 🎲 Surah acak
getAyahByNumber(id) number 📝 Ayat berdasarkan nomor global
getSingleAyah(surat, ayat) number, number 🎯 Ayat spesifik
getAyahRange(surat, start, end) number, number, number 📏 Range ayat dalam surah
getJuz(id) number 📚 Juz 1-30
getRandomAyah() - 🎲 Ayat acak
getAllThemes() - 🏷️ Tema-tema Al-Quran
getAyahByTheme(id) number 📑 Ayat berdasarkan tema

🤲 Prayers & Hadith

Method Parameters Description
getDoaSources() - 📚 Sumber-sumber doa
searchDoa(query) string 🔍 Cari doa berdasarkan kata kunci
getRandomDoa() - 🎲 Doa acak
getRandomHadistArbain() - 🎲 Hadist Arbain acak
getRandomHadistBukhari() - 🎲 Hadist Bukhari acak

💡 Examples

🏙️ Get Prayer Times for Jakarta

const cities = await api.getCities();
const jakartaId = cities.find(city => city.lokasi === 'Jakarta').id;
const todayPrayer = await api.getPrayerTimes(jakartaId, '2024-01-01');

📖 Read Random Quran Verse

const randomAyah = await api.getRandomAyah();
console.log(`${randomAyah.surat.nama} - Ayat ${randomAyah.nomor_ayat}`);
console.log(randomAyah.ar);
console.log(randomAyah.tr);

🤲 Daily Prayer Collection

const morningPrayer = await api.searchDoa('pagi');
const randomDua = await api.getRandomDoa();
const hadith = await api.getRandomHadistBukhari();

📅 Islamic Calendar Integration

const hijriToday = await api.getTodayHijriDate();
const convertedDate = await api.getHijriDate('2024-01-01');
console.log(`Today in Hijri: ${hijriToday.hijri}`);

🌟 Asmaul Husna Display

const allNames = await api.getAllHusna();
const randomName = await api.getRandomHusna();
const specificName = await api.getHusnaByNumber(1);

⚙️ Custom Configuration

const api = new MurotalAPI('https://cloudku.us.kg');

🛡️ Error Handling

try {
  const result = await api.getPrayerTimes('1', '2024-01-01');
  console.log('✅ Success:', result);
} catch (error) {
  console.error('❌ API Error:', error.message);
  
  if (error.code === 'NETWORK_ERROR') {
    console.log('🔄 Retrying in 5 seconds...');
  }
}

🔧 Requirements

Environment Version Status
Node.js 20+ ✅ Supported
Browser ES6+ ✅ Supported
TypeScript 4.5+ ✅ Compatible

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📊 Project Stats

GitHub stars GitHub forks NPM downloads


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🔗 Quick Links

GitHub NPM Documentation

Made with ❤️ by AlfiDev

Bringing Islamic resources to developers worldwide 🌍


🎯 Roadmap

  • [ ] TypeScript definitions
  • [ ] GraphQL support
  • [ ] Offline caching
  • [ ] React hooks package
  • [ ] Vue.js plugin
  • [ ] CLI tool
  • [ ] WebSocket real-time updates

If this package helps your project, please consider giving it a ⭐ on GitHub!

Package Sidebar

Install

npm i cloudku-murotal

Weekly Downloads

11

Version

1.0.1

License

MIT

Unpacked Size

62.4 kB

Total Files

7

Last publish

Collaborators

  • alfidev