Skip to content

kabeep/zodiac-animals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

zodiac-animals

๐Ÿผ A JavaScript zodiac animals utility library

NodeJS License NPM Codecov Codacy Badge CircleCI

English | ็ฎ€ไฝ“ไธญๆ–‡

Insights

๐Ÿ“– 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.