Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alwalxed/zero-deps-prayer-times
Embedable Islamic prayer times calculator for date and coordinates.
https://github.com/alwalxed/zero-deps-prayer-times
bun coordinates embedable islam islamic islamic-prayer-times npm-package prayer-times prayertimes typescript utilities utility zero-dependency
Last synced: about 2 months ago
JSON representation
Embedable Islamic prayer times calculator for date and coordinates.
- Host: GitHub
- URL: https://github.com/alwalxed/zero-deps-prayer-times
- Owner: alwalxed
- License: mit
- Created: 2024-12-18T00:21:14.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-18T09:05:58.000Z (about 2 months ago)
- Last Synced: 2024-12-18T09:34:25.074Z (about 2 months ago)
- Topics: bun, coordinates, embedable, islam, islamic, islamic-prayer-times, npm-package, prayer-times, prayertimes, typescript, utilities, utility, zero-dependency
- Language: TypeScript
- Homepage: https://npmjs.com/package/zero-deps-prayer-times
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zero Dependencies Prayer Times
Embedable Islamic prayer times calculator for date and coordinates.
## Installation (NPM)
```
npm install zero-deps-prayer-times
```## Usage
```js
import { calculatePrayerTimes } from "zero-deps-prayer-times";const date = new Date();
const coordinates = { latitude: 21.42251, longitude: 39.826168 };// similar to supabase, returns data and error
const { data, error } = calculatePrayerTimes(date, coordinates);if (error) {
console.error("Error:", error.message);
return;
}console.log("Prayer Times Data:", data);
```## Returned Data
`data` is an object containing prayer times and extras. Example output:
```js
{
"prayers": {
"fajr": "05:30 AM",
"dhuhr": "1:02 PM",
"asr": "3:30 PM",
"maghrib": "6:45 PM",
"isha": "8:00 PM"
},
"extras": {
"sunrise": "06:00 AM",
"dayOfYear": 345,
"dayLength": "12:30"
}
}
```## Contributing
If you encounter any issues or have suggestions, please submit them via issues or pull requests.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/alwalxed/zero-deps-prayer-times/blob/main/LICENSE) file for details.