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

jpx-holidays

v0.1.0

Published

JPX (Tokyo Stock Exchange) holiday checker - 東証の休場日判定

Downloads

111

Readme

jpx-holidays

JPX (Tokyo Stock Exchange) holiday checker - 東証の休場日判定ライブラリ

npm version

Install

npm install jpx-holidays

Usage

import {
  isJpxHoliday,
  isJpxTradingDay,
  getNextTradingDay,
  getPrevTradingDay,
  getTradingDays,
  countTradingDays,
  addTradingDays,
} from 'jpx-holidays'

// 休場日かどうか(土日は含まない)
isJpxHoliday('2026-01-01')  // true (元日)
isJpxHoliday('2026-12-31')  // true (大晦日)

// 取引日かどうか(土日も考慮)
isJpxTradingDay('2026-02-28')  // false (土曜日)
isJpxTradingDay('2026-03-02')  // true (月曜日)

// 次/前の取引日を取得
getNextTradingDay('2026-02-27')  // '2026-03-02' (金→月)
getPrevTradingDay('2026-03-02')  // '2026-02-27' (月→金)

// 期間内の取引日一覧
getTradingDays('2026-01-01', '2026-01-10')
// → ['2026-01-05', '2026-01-06', '2026-01-07', '2026-01-08', '2026-01-09']

// 年間の取引日数
countTradingDays(2026)  // → 245

// N営業日後の日付
addTradingDays('2026-02-27', 3)   // '2026-03-04'
addTradingDays('2026-03-02', -1)  // '2026-02-27'

JPX休場日ルール

このライブラリは以下のルールで休場日を判定します:

  • 土曜日・日曜日
  • 国民の祝日
  • 振替休日(祝日が日曜の場合、翌平日が休み)
  • 国民の休日(祝日に挟まれた平日)
  • 12月31日(大晦日)
  • 1月2日・1月3日(年始)

普通の祝日ライブラリとの違い

| 機能 | japanese-holidays等 | jpx-holidays | |------|---------------------|--------------| | 国民の祝日 | ✅ | ✅ | | 振替休日 | ✅ | ✅ | | 国民の休日 | △ | ✅ | | 12/31 大晦日 | ❌ | ✅ | | 1/2, 1/3 年始 | ❌ | ✅ | | 土日判定込み | ❌ | ✅ | | 次/前の取引日 | ❌ | ✅ | | N営業日計算 | ❌ | ✅ |

API

isJpxHoliday(date: string): boolean

指定した日付がJPX休場日かどうかを判定します(土日は含まない)。

isJpxTradingDay(date: string): boolean

指定した日付が取引日かどうかを判定します(土日も考慮)。

getNextTradingDay(date: string): string

次の取引日を取得します。

getPrevTradingDay(date: string): string

前の取引日を取得します。

getTradingDays(startDate: string, endDate: string): string[]

期間内の取引日一覧を取得します。

countTradingDays(year: number): number

年間の取引日数を取得します。

addTradingDays(date: string, days: number): string

N営業日後(または前)の日付を取得します。

getJpxHolidays(year: number): string[]

指定した年のJPX休場日一覧を取得します。

getJapaneseHolidays(year: number): string[]

指定した年の国民の祝日一覧を取得します。

License

MIT