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

calcchinesecalendar

v2.7.0

Published

ESM/WebAssembly bindings for the CalcChineseCalendar lunar ephemeris, astronomy, and calendar engine.

Readme

calcchinesecalendar

calcchinesecalendar ships the lunar engine as an ESM-oriented WebAssembly package for Chinese calendar, almanac, and astronomy computations.

It is intended for installation from npm and direct use in Node.js or other ESM environments.

The upstream C++ repository and the full reference documentation are available at:

  • GitHub: https://github.com/lzray-universe/CalcChineseCalendar/

If you need the full CLI reference, C++ API, C API, i18n details, repository layout, or release artifacts, use the GitHub repository as the primary reference.

Installation

npm install calcchinesecalendar

Quick start

import { coreDay, createLunar } from "calcchinesecalendar";

const data = await coreDay({ ephem: "@series", date: "2025-06-01" });
console.log(data.data.phase_name);

const lunar = await createLunar();
const ganzhi = lunar.ganzhi({ ephem: "@series", date: "2025-09-07" });
console.log(ganzhi.data.day.text);

Using BSP ephemerides

The ephem option selects the ephemeris source:

  • use @series to force the built-in VSOP87A + ELPMPP02 fallback
  • pass a mounted or accessible BSP path to use JPL DE ephemerides

For Node.js, a practical pattern is to write the BSP into the wasm filesystem first:

import { createLunar } from "calcchinesecalendar";
import { readFile } from "node:fs/promises";

const lunar = await createLunar();
const bsp = await readFile("de442.bsp");

await lunar.mkdir("/ephem");
await lunar.writeFile("/ephem/de442.bsp", bsp);

const data = lunar.day({ ephem: "/ephem/de442.bsp", date: "2025-06-01" });
console.log(data.data.phase_name);

Public API overview

The package exposes:

  • top-level async helpers such as coreDay, ganzhi, day, and search
  • createLunar() for creating an isolated client with explicit state control
  • native core APIs such as coreDay, ganzhi, ganzhiMonth, and calcEot
  • high-level methods such as day, monthview, at, convert, search, eclipse, festival, almanac, and info
  • raw run and runJson access
  • filesystem helpers such as writeFile, mkdir, and exists

Search example

import { search } from "calcchinesecalendar";

const result = await search({
  ephem: "@series",
  query: "next full moon",
  fromTime: "2025-06-01T00:00:00+08:00",
  count: 2,
});

for (const item of result.data) {
  console.log(item.code, item.loc_iso);
}

Notes

  • npm package name: calcchinesecalendar
  • The package is ESM-only
  • Node.js 18 or newer is required
  • The published package includes the wasm runtime files in dist/

For the full CLI, C++ API, C API, i18n documentation, and repository-level usage notes, see the GitHub C++ repository:

  • https://github.com/lzray-universe/CalcChineseCalendar/