npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

astrology-insights

v1.0.6

Published

Astrology Insights for Applications.

Downloads

511

Readme


Astrology Insights for JavaScript 🌌

A comprehensive toolkit for astrology calculations and utilities, built for JavaScript developers. This package provides functions for biorhythms, zodiac sign determination, compatibility checks, and other astrology-related computations. Astrology Insights is a Node.js library designed to calculate important astrological and astronomical events, such as sunrise, sunset, Abhijit Muhurat, Choghadiya, and more. This library is perfect for those who want to integrate astrological insights into their applications.

Features ✨

  • Biorhythm Calculations: Analyze physical, emotional, intellectual, and intuitive cycles.

  • Sunrise and Sunset Calculator
    Calculate accurate sunrise and sunset times for any given date, latitude, longitude, and timezone.

  • Abhijit Muhurat
    Calculate the most auspicious Abhijit Muhurat during the day, based on the middle segment of the day.

  • Day and Night Choghadiya
    Determine the start and end times of each Choghadiya (day and night) based on Vedic astrology principles.


Installation 📦

Install the package using npm:

npm install astrology-insights

Usage 🛠️

Here’s how you can use the features of this toolkit:

1. Biorhythm Calculations

const { calculateBioRhythms } = require("astrology-insights");

const timezone = "UTC";
const dob = "1994-11-11";
const currentDate = "2024-12-06";
const daysToDisplay = 30;

const biorhythms = calculateBioRhythms(currentDate, dob, timezone, daysToDisplay);
console.log(biorhythms);

Output:

{
  "survivalDays": 12058,
  "data": [
    {
      "label": "Physical",
      "borderColor": "#FF0000",
      "description": "Represents your physical energy, strength, and stamina.",
      "data": [
        { "dayOffset": 0, "value": 89 },
        ...
      ]
    },
    ...
  ]
}

Importing the Library for Astrology Numbers

const { 
    calculateSunriseSunset, 
    calculateAbhijeetMuhurt, 
    calculateChoghadiya 
} = require("astrology-insights");

1. Calculate Sunrise and Sunset

const date = "2024-11-24";
const latitude = 28.6139; // Example: New Delhi
const longitude = 77.2090;
const timezone = "Asia/Kolkata";

const { sunrise, sunset } = calculateSunriseSunset(date, latitude, longitude, timezone);
console.log(`Sunrise: ${sunrise}, Sunset: ${sunset}`);

2. Calculate Abhijit Muhurat

const abhijitMuhurat = calculateAbhijeetMuhurt(date, sunrise, sunset, latitude, longitude, timezone);

console.log(`Abhijit Muhurat Start: ${abhijitMuhurat.start_time}, End: ${abhijitMuhurat.end_time}`);

3. Calculate Day and Night Choghadiya

const choghadiyas = calculateChoghadiya(date, sunrise, sunset, timezone);

choghadiyas.day.forEach(({ type, start_time, end_time }) => {
    console.log(`${type}: ${start_time} - ${end_time}`);
});

choghadiyas.night.forEach(({ type, start_time, end_time }) => {
    console.log(`${type}: ${start_time} - ${end_time}`);
});

Output Examples

Sunrise and Sunset

Sunrise: 06:50:59, Sunset: 17:24:33

Abhijit Muhurat

Abhijit Muhurat Start: 11:27:46, End: 12:07:46

Day and Night Choghadiya

Day Choghadiya

Udveg: 06:50:59 - 08:10:11
Char: 08:10:11 - 09:29:23
Labh: 09:29:23 - 10:48:35
Amrit: 10:48:35 - 12:07:46
Kaal: 12:07:46 - 13:26:58
Shubh: 13:26:58 - 14:46:10
Rog: 14:46:10 - 16:05:22
Udveg: 16:05:22 - 17:24:33

Night Choghadiya

Shubh: 17:24:33 - 18:54:44
Rog: 18:54:44 - 20:24:55
Kaal: 20:24:55 - 21:55:06
Labh: 21:55:06 - 23:25:17
Udveg: 23:25:17 - 00:55:28
Amrit: 00:55:28 - 02:25:39
Char: 02:25:39 - 03:55:50
Rog: 03:55:50 - 05:26:01

License 📜

This project is licensed under the MIT License.

Contribute 🤝

Feel free to contribute to the project! Open an issue or submit a pull request to improve the functionality.


Contributions 🤝

We welcome contributions! Feel free to submit issues or pull requests to improve this toolkit. To get started:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Commit your changes: git commit -m "Add a new feature".
  4. Push to the branch: git push origin feature-name.
  5. Open a pull request.

License 📜

This project is licensed under the MIT License.


Acknowledgments 🙌

  • Luxon for date-time calculations.
  • Inspired by the works of Wilhelm Fliess for biorhythm theory.

For any questions or feature requests, feel free to open an issue or contact me at [email protected].

Happy coding and stargazing! 🌠