findyourstar
v1.0.2
Published
Get your zodiac sign, ascendant, and a brief description based on your birth date.
Maintainers
Readme
findyourstar
JavaScript library to calculate your zodiac sign and a brief description based on your birth date.
Supports multiple languages with internationalization (i18n) and colorful terminal output using chalk.
Installation
npm install findyourstarBasic Usage with Import
Import the library in your project using ES Modules:
import { setLanguage, getZodiacSignMessage, formatBirthDate, getZodiacSign, getMore } from 'findyourstar';
Set the Language
The default language is English ('en'). Change it by calling:
setLanguage('it'); // Set language to Italian
Create and Format a Birth Date
Always pass a JavaScript Date object to the functions:
const myDate = new Date('2002-08-31');
console.log(formatBirthDate(myDate)); // Output: "You entered day: 31 and month: 8" (translated)Get Zodiac Sign and Colorful Description
const message = getZodiacSignMessage(myDate);
console.log(message.zodiac); // Zodiac sign in magenta (colored output)
console.log(message.description); // Description in blue (colored output)Additional Functions
- Get only the zodiac sign name (string without colors):
console.log(getZodiacSign(myDate)); // e.g., "Virgo"- Get only the translated description (colored):
console.log(getMore('Aquarius'));