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 🙏

© 2025 – Pkg Stats / Ryan Hefner

kor-lunar

v1.4.0

Published

한국 음력 변환 유틸 / Korean lunar calendar converter

Downloads

368

Readme

kor-lunar

이 라이브러리는 학습용으로 제작되었으며, 한국천문연구원(KASI)의 음력·양력 데이터를 기반으로 한 자바스크립트 라이브러리입니다. 오프라인 환경에서도 사용할 수 있도록 구현되었습니다.

⚠️ 주의: 데이터는 2025년 5월 20일 기준으로 갱신되었습니다.
이후의 중요한 변경 사항이 반영되지 않을 수 있으므로,
중요한 작업에는 아래 한국천문연구원 공식 API를 사용하시기 바랍니다.

특징

  • 음력 ↔ 양력 변환 지원

  • 윤달 처리 가능 (isLeapMonth 옵션)

  • 음력 간지 출력: 세차(secha), 월건(wolgeon), 일진(iljin) 포함

    • 윤달인 경우 wolgeon은 빈 문자열로 반환됩니다
  • 오프라인 환경에서도 사용 가능

  • 예제 사이트

지원 날짜 범위

  • toLunar: 양력 → 음력 날짜 범위 1890년 1월 21일 ~ 2050년 12월 31일
  • toSolar: 음력 → 양력 날짜 범위 1890년 1월 1일 ~ 2050년 11월 18일

범위를 벗어난 날짜가 입력될 경우 RangeError가 발생하며, 오류 메시지에 입력한 날짜 정보가 포함됩니다.

설치

npm install kor-lunar

사용법

모듈 불러오기

import korLunar from "kor-lunar";
// 또는
const korLunar = require("kor-lunar");

브라우저 CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kor-lunar.min.js"></script>

예제

예제 사이트

import korLunar from "kor-lunar";

// 양력 → 음력
console.log(korLunar.toLunar(2025, 6, 25));
// {
//   year: 2025,
//   month: 6,
//   day: 1,
//   isLeapMonth: false,
//   secha: '을사',
//   wolgeon: '계미',
//   iljin: '을축',
//   julianDay: 2460852,
//   dayOfWeek: 3
// }

console.log(korLunar.toLunar(2025, 7, 25));
// {
//   year: 2025,
//   month: 6,
//   day: 1,
//   isLeapMonth: true,
//   secha: '을사',
//   wolgeon: '',        // 윤달인 경우 월건은 빈 문자열
//   iljin: '을미',
//   julianDay: 2460882,
//   dayOfWeek: 5
// }

// 음력 → 양력
console.log(korLunar.toSolar(2025, 6, 1, false));
// { year: 2025, month: 6, day: 25 }

console.log(korLunar.toSolar(2025, 6, 1, true));
// { year: 2025, month: 7, day: 25 }

권장되진 않지만, korLunar.LunarDatakorLunar.SolarData 같은 내부 함수에 직접 접근할 수도 있습니다.
이를 통해 단순 음력 변환을 넘어, 더 다양한 기능을 구현할 수 있습니다.
예제 사이트: 음력 달력

라이선스

MIT

출처 및 참고 자료

  • 한국천문연구원: https://www.kasi.re.kr
  • 공공데이터포털: https://www.data.go.kr/data/15012679/openapi.do