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

@tuquet/lunar

v0.1.0

Published

Astronomical Vietnamese Lunar-Solar calendar converter, recurrence engine, and Can Chi calculator

Readme

@tuquet/lunar

Astronomical Vietnamese Lunar-Solar calendar converter, recurrence engine, and Can Chi calculator.

npm version License: MIT


🌟 Features

  • 🌓 Astronomical Accuracy: Implements Dr. Ho Ngoc Duc's algorithm (based on Jean Meeus' Astronomical Algorithms) adapted for UTC+7 (Hanoi/Ho Chi Minh City).
  • 🔄 Bidirectional Conversion: Seamlessly convert Solar ➔ Lunar and Lunar ➔ Solar dates (including leap month support).
  • 🗓️ Recurrence & Event Discovery: Find next upcoming lunar dates for Giỗ (death anniversaries), Ngày Rằm (15th), and Mùng 1 (New Moon).
  • 🐅 Can Chi & 24 Tiết Khí: Calculates Can Chi for Year (with Vietnamese Zodiac Animal), Month, Day, and Hour, plus 24 Solar Terms (Tiết khí).
  • 🪶 Zero Dependencies & Dual ESM/CJS: Lightweight, runs anywhere (Node.js, Browser, Edge, Cloudflare Workers).

📦 Installation

# Using pnpm
pnpm add @tuquet/lunar

# Using npm
npm install @tuquet/lunar

# Using yarn
yarn add @tuquet/lunar

🚀 Usage

1. Convert Solar to Lunar Date

import { solarToLunar } from '@tuquet/lunar';

// Convert 2024-02-10 (Tết Giáp Thìn)
const lunar = solarToLunar({ day: 10, month: 2, year: 2024 });
console.log(lunar);
// { day: 1, month: 1, year: 2024, isLeap: false }

2. Convert Lunar back to Solar Date

import { lunarToSolar } from '@tuquet/lunar';

// What solar date is 01/01/2025 Lunar?
const solar = lunarToSolar({ day: 1, month: 1, year: 2025 });
console.log(solar);
// { day: 29, month: 1, year: 2025 }

3. Find Next Upcoming Lunar Events (Giỗ, Rằm, Mùng 1)

import { getNextAnnualLunarDate, getNextFullMoon, getNextNewMoon } from '@tuquet/lunar';

// Find next Giỗ (15th of 8th lunar month)
const nextGio = getNextAnnualLunarDate(15, 8);
console.log(
  `Ngày giỗ tiếp theo là: ${nextGio.solar.day}/${nextGio.solar.month}/${nextGio.solar.year} (còn ${nextGio.daysUntil} ngày)`
);

// Find next Ngày Rằm (15th lunar day)
const nextRam = getNextFullMoon();
console.log(
  `Ngày Rằm tiếp theo là: ${nextRam.solar.day}/${nextRam.solar.month}/${nextRam.solar.year}`
);

4. Can Chi & Zodiac Animal

import { getCanChiYear, getCanChiDay, getFullLunarDate } from '@tuquet/lunar';

const year = getCanChiYear(2024);
console.log(year.full); // "Giáp Thìn"
console.log(year.animal); // "Rồng"

const fullInfo = getFullLunarDate(new Date());
console.log(
  `Hôm nay là ngày ${fullInfo.canChiDay.full}, tháng ${fullInfo.canChiMonth.full}, năm ${fullInfo.canChiYear.full} (${fullInfo.solarTerm})`
);

📄 License

MIT © Tuquet