Skip to main content

A TypeScript class representing Zodiac signs with associated information, including names in multiple languages, Chinese zodiac signs, elements, and Yin-Yang attributes

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
This package works with Browsers
JSR Score
100%
Published
3 months ago (0.1.1)

License: MIT

Zodiac Signs / Chinese Zodiac Signs

Provides a zodiac sign & chinese zodiac sign depending a birthday

Installation

<script src="https://cdn.jsdelivr.net/gh/besrourms/zodiacsigns@latest/index.min.js"></script>

Examples

Getting a zodiac sign from a date

// Return 'Sagittarius: The Archer'
console.log(new ZodiacSign('1991-11-30').sign)

Getting a chinese zodiac sign from a date

// Return {"sign": "Rat", "element": "Fire", "yinyang": "Yang"}
console.log(new ZodiacSign('1 Feb 1997 00:12:00 GMT').chinese)

Getting a sign with translation

// Overload the default language (format xx)
console.log(new ZodiacSign('1 Feb 1997 00:12:00 GMT', 'ar').chinese);

Translation

For the moment, the only available languages are English, French, Spanish, Arabic, Ukrainian, Chinese, Turkish and Japanese. Fell free to participate to the translation in any other language.

Available languages

  • English (en)
  • French (fr)
  • Spanish (es)
  • Arabic (ar)
  • Ukrainian (ua)
  • Chinese (zh)
  • Turkish (tr)
  • Japanese (ja)
  • Indonesian (id)
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @besrourms/zodiacsigns

Import symbol

import * as mod from "@besrourms/zodiacsigns";

Add Package

npx jsr add @besrourms/zodiacsigns

Import symbol

import * as mod from "@besrourms/zodiacsigns";

Add Package

yarn dlx jsr add @besrourms/zodiacsigns

Import symbol

import * as mod from "@besrourms/zodiacsigns";

Add Package

pnpm dlx jsr add @besrourms/zodiacsigns

Import symbol

import * as mod from "@besrourms/zodiacsigns";

Add Package

bunx jsr add @besrourms/zodiacsigns

Import symbol

import * as mod from "@besrourms/zodiacsigns";