npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wiz-calendar

v1.0.12

Published

巫师万年历是一款采用天文算法实现的高精度万年历模块。提供了简便易用的API,清晰易读的面向对像代码设计,可以很容易地开发一个万年历和进行历法研究。

Readme

WizCalendar(巫师万年历)

巫师万年历是一款采用天文算法实现的高精度万年历模块。提供了简便易用的API,清晰易读的面向对像代码设计,可以很容易地开发一个万年历和进行历法研究。 主要参考了寿星万年历。

如何使用:

同时支持javascript和typescript两种语言。

  1. 通过npm安装

    > npm i wiz-calendar
  2. 导入模块

    javascript导入方式:

    const {WizCalendar, SolarDate, LunarDate, JulianDate, MoonPhase,MoonPhaseName} = require("wiz-calendar");

    typescript导入方式:

    import {WizCalendar, SolarDate, LunarDate, JulianDate, MoonPhase,MoonPhaseName} from 'wiz-calendar';

基本用法:

  1. 阳历转阴历
    //let solar = new SolarDate(1977, 5, 18);
    let solar = WizCalendar.solarDate(1977, 5, 18);
    let lunar: LunarDate = solar.getLunarDate();
    lunar.format('date'); //1977-04-01+0
  2. 阴历转阳历
    //let lunar = new LunarDate(1977,4,1);
    let lunar = WizCalendar.lunarDate(1977,4,1);
    let solar: SolarDate = lunar.getSolarDate(); 
    solar.format('date'); //1977-05-18
  3. 阳历转儒略日
    //let solar = new SolarDate(1977, 5, 18);
    let solar = WizCalendar.solarDate(1977, 5, 18);
    let julian: JulianDate = solar.getJulianDate(); 
    julian.getJD(); //2443282
  4. 阴历转儒略日
    //let lunar = new LunarDate(1977, 4, 1, 12);
    let lunar = WizCalendar.lunarDate(1977,4,1);
    let julian: JulianDate = lunar.getJulianDate(); 
    julian.getJD(); //2443282
  5. 儒略日转阳历
    let mjd = 5225.942824074067; //J2000算起的儒略日
    //let julian = new JulianDate(mjd);
    let julian = WizCalendar.julianDate(mjd);
    let solar: SolarDate = julian.getSolarDate();
    solar.format('datetime'); //2014-04-23 10:37:40
  6. 儒略日转阴历
    let mjd = -8263; //J2000算起的儒略日
    //let julian = new JulianDate(mjd);
    let julian = WizCalendar.julianDate(mjd);
    let lunar: LunarDate = julian.getLunarDate();
    lunar.format('datetime'); //1977-04-01+0 12:00:00
  7. 获取二十四节气
    //let lunar = new LunarDate(1977,4,1);
    let lunar = WizCalendar.lunarDate(1977,4,1);
    let julian: JulianDate = lunar.getSolarTerm(SolarTermName.WinterSolstice);
  8. 阴历干支纪历
    //let lunar = new LunarDate(1977,4,1);
    let lunar = WizCalendar.lunarDate(1977,4,1);
    lunar.getYearStem() + lunar.getYearBranch(); //丁巳
    lunar.getMonthStem() + lunar.getMonthBranch(); //乙巳
    lunar.getDayStem() + lunar.getDayBranch(); //乙亥
  9. 获取命理八字
    //2014-4-23 10:37:40   
    //甲午年 戊辰月 甲子日 己巳时 真太阳 10:24:48
    //let eight = new EightChar(5225.942824074067);
    let eight = WizCalendar.eightChar(5225.942824074067);
    eight.getYear(); //甲午
    eight.getMonth(); //戊辰
    eight.getDay(); //甲子
    eight.getHour(); //己巳
    
  10. 获取月相(朔望)
    let lunar = WizCalendar.lunarDate(1977,4,1);
    let phase = lunar.getMoonPhase(MoonPhaseName.NewMoon);
    phase.getJulianDate().getMJDN(); //-8263
  11. 获取24节气
    let lunar = WizCalendar.lunarDate(1977,4,1);
    let term = lunar.getSolarTerm(SolarTermName.WinterSolstice);
    term.getJulianDate().getMJDN(); //-8045
  12. 其它略