⭐A lightweight open-source JavaScript library for obtaining The Purple Star Astrology (Zi Wei Dou Shu) astrolabe information.. 支持多语言轻量级获取紫微斗数排盘信息的javascript开源库。
MIT License
A lightweight astrolabe generator of The Purple Star Astrology(Zi Wei Dou Shu).
It's used to obtain the data of The Purple Star Astrology (Zi Wei Dou Shu)
.
Input
Feature list
12 palaces
data of Zi Wei Dou Shu.zodiac
sign
horoscope
(decadal
, turnly
, yearly
, monthly
, daily
, timely
)stars
(dacadal
and yearly
)palace
includes specific stars
surrounded palaces
of specific palace
include specific stars
surrounded palaces
of specific palace
include specific mutagen
mutaged
surrounded palaces
of specific star
include specific mutagen
brightness
mutagen
by heavenly stem
palace
by star
surrounded palaces
by palace
surrounded palaces
by star
opposite
palace by star
Other
multilingual input/output
you can mix multiple languages when passing parameters and specify output language. we support Simplified Chinese, Traditional Chinese, English, Japanese, Korean and Vietnamese. however, English translation is not stardand. so I just translate them by meaning. if you're good at English and well known about Zi Wei Dou Shu, welcome to PR. any language is welcome.
chain invoking
if you want to check if the surrounded palaces
of emperor
is focused
, you can do it like this:
import { astro } from 'iztro';
const astrolabe = astro.bySolar('2000-8-16', 2, 'male', true, 'en-US');
astrolabe.star('emperor').surroundedPalaces().haveMutagen('focused');
Configuration and plugins
There are many Ziwei Dou Shu genres, and the mutagens and star brightness of different genres will be slightly different. In order to meet the needs of different genres and function expansion, iztro has added global configuration and third-party plug-in functions in version v2.3.0. For details, see Configuration Document
you can choose any package manager to install iztro
.
NPM
npm install iztro -S
Yarn
yarn add iztro
pnpm
pnpm install iztro -S
This is a very simple example to show how to use iztro
to get the astrolabe data. please visit develop document for details.
ES6 Module
import { astro } from 'iztro';
// get astrolabe data by solar date
const astrolabe = astro.bySolar('2000-8-16', 2, 'male', true, 'en-US');
// get astrolabe data by lunar date
const astrolabe = astro.byLunar('2000-7-17', 2, 'male', false, true, 'en-US');
CommonJS
var iztro = require('iztro');
// get astrolabe data by solar date
var astrolabe = iztro.astro.bySolar('2000-8-16', 2, 'male', true, 'en-US');
// get astrolabe data by lunar date
var astrolabe = iztro.astro.byLunar('2000-7-17', 2, 'male', false, true, 'en-US');
If you're interested in iztro
and wish to join us,it's very welcome. You can contribute by:
fork
this code to your repository and create PRs for your changes.localization
files. please refer to locales and create the localization files for your lanuage.You can generate an astrolabe by using the returned data. Of course it's just an example. You can focus on astrolabe design or data analyzation. This program solves the most tedious work for you, so that you can put more energy on the things you need to pay attention to.
MIT License
Copyright © 2023 All Contributors