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 🙏

© 2026 – Pkg Stats / Ryan Hefner

astrology-js

v0.6.0

Published

A library for getting some Astrology info from the js side

Downloads

68

Readme

Astrology

An open source javascript project to simply getting general astrological information within web-applications

npm version Download

Version Information


Check out the version information page for more information.

License


This software is distributed as Open Source software following the GNU General Public License, version 3 (GPL-3.0)

Description


This project is aimed to be an open source project to design a simple javascript class that could be used to generate general astrological information to individuals based on birth date information and such. The idea is that the class could be instantiated and used in a general web-project and then accessed through a set of different public methods that add data, do calculations and present information back to the user. Currently the class is meant to load some general information data about the different zodiac signs from a json resource. The default settings is to load the data from a json-files to get the specific date information for each zodiac signs aswell as a more detailed description about what a specific zodiac sign entails. The source for the json data could be altered through providing a connectionObject to the constructor method as explained below.

How to use the Astrology class


Within the web-pages/applications you would like to use the class, you should include the script, within the <head>..</head> section or preferably within the last section of the <body>..</body> section, such as for instance

...
<script src="../js/astrology.js"></script>
</body>
</html>

Then within an actual javascript file, (could be within a jquery statement aswell), the class should be instantiated with an optional connectionObject parameter being passed to the constructor like:


var astrology = new Astrology();

or..


var connectionObject = {
     dateDataUrl: url_to_where_to_fetch_the_date_data,
     descriptionDataUrl: url_to_where_to_fetch_the_description_data
 }

var astrology = new Astrology(connectionObject);

When interacting with the class there are three methods that saves the date needed to find out the zodiac sign. First there is the method addDay(dayNumber) that takes in a number between 1-31 as a valid day number in a month, and then there is addMonth(monthNameOrMonthNumber) which takes in a string with a valid month-name such as for example january, february etc... or a valid month-number string ranging from 1-12, such as 1, 12 or 01, 07 for instance. Then there is also a method called addFullDateString(dateString) which takes in a date string in the format YYYY-MM-DD. This is naturally supported as the output from the native html5-method <input type="date"> , which in turn is supported by most modern browsers, except Internet Explorer. Read more here.


astrology.addDay(dayNumber);

astrology.addMonth(monthNameOrMonthNumber);

astrology.addFullDateString(dateString)

To actually get the zodiac sign or the zodiac sign description from an astrology object, the methods fetchZodiacSign and fetchZodiacSignDescription both fetches different strings that could be used within the DOM-structure or as the user see fit. The fetchZodiacSignDescription method returns a description and the fetchZodiacSign returns the zodiac name, both in the format of a string. They are called upon such as:

astrology.fetchZodiacSign();
astrology.fetchZodiacSignDescription();

To get a more hands on example on how to implement the class and use it within an actual web-application check out the Html implementation code example