Package Exports
- @kabeep/zodiac-animals
Readme
đ Introduction
Considering tree-shaking and the rigor required due to cultural differences, the output will exclude i18n content.
A lite utility library using Lunar Calendar.
See documentation.
âī¸ Installation
npm install @kabeep/zodiac-animals --save
yarn add @kabeep/zodiac-animals
pnpm add @kabeep/zodiac-animals
đ Usage
CommonJS
const { ANIMALS, zodiac, Zodiac: IZodiac } = require('@kabeep/zodiac-animals');
ESModule
import { ANIMALS, zodiac, type Zodiac } from '@kabeep/zodiac-animals';
Methods: zodiac(date)
zodiac(new Date()) as Zodiac;
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
date |
Date |
No | - | Date Object of Gregorian Calendar |
Returns: interface Zodiac
Result Object:
Key | Type | Required | Description |
---|---|---|---|
name |
string |
true | Zodiac Animal Name |
mate |
string[] |
true | Zodiac Animal Mates |
traits |
string[] |
true | Zodiac Animal Traits |
alias |
string |
false | Zodiac Animal i18n Alias |
year |
number |
true | Lunar Year of Date Input |
month |
number |
true | Lunar Month of Date Input |
day |
number |
true | Lunar Day of Date Input |
isLeapMonth |
boolean |
true | Lunar Leap Month Flag of Date Input |
from |
Date |
true | Gregorian Date of the First Day of the Lunar Year (Return an Invalid Date if an Exception Occurs) |
to |
Date |
true | Gregorian Date of the Last Day of the Lunar Year (Return an Invalid Date if an Exception Occurs) |
đ Related
- lunar-date-fns - đī¸ A JavaScript lunar date utility library.
- lunar-birthday-cli - đ A Node.js Library to list the lunar birthday in terminal.
đ Credits
- zodiacAnimals2 - Reference is made to data design of this repository.
đ¤ Contribution
Contributions via Pull Requests or Issues are welcome.
đ License
This project is licensed under the MIT License. See the LICENSE file for details.