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

taiwan-holiday-cli

v1.0.1

Published

Taiwan holiday CLI tool - Query Taiwan holidays from command line

Readme

taiwan-holiday-cli

CI npm version npm downloads node License: MIT

台灣國定假日查詢 CLI 工具 - 快速查詢台灣假期、計算工作天數

🎉 現已發佈於 npm,可直接安裝使用!

Features

  • 查詢指定日期是否為假期
  • 支援自然語言日期輸入(today, tomorrow, next monday...)
  • 查詢日期範圍內的假期
  • 計算工作天數統計
  • 支援多種輸出格式(simple, json, table)
  • 內建快取機制,離線可用
  • Shell 自動補全支援

Requirements

  • Node.js >= 20.0.0

Installation

# 全域安裝
npm install -g taiwan-holiday-cli

# 或使用 npx 直接執行(無需安裝)
npx taiwan-holiday-cli today

驗證安裝:

holiday --version
# 1.0.0

Quick Start

# 查詢今天是否為假期
holiday today

# 查詢指定日期
holiday 2026-10-10

# 查詢明天
holiday tomorrow

# 查詢下週一
holiday "next monday"

Commands

日期查詢

# 查詢指定日期
holiday check <date>
holiday <date>              # 簡寫

# 查詢今天
holiday today

# 查詢接下來的假期
holiday next                # 顯示下一個假期
holiday next 5              # 顯示接下來 5 個假期
holiday next 5 --skip-weekends  # 跳過週末,只顯示特殊假日

範圍查詢

# 查詢日期範圍內的假期
holiday range <start> <end>
holiday range 2026-01-01 2026-01-31

# 查詢指定月份
holiday month [year-month]
holiday month 2026-10

統計功能

# 年度假期統計
holiday stats <year>
holiday stats 2026

# 月份假期統計
holiday stats <year> <month>
holiday stats 2026 10

# 計算工作天數
holiday workdays <year-month>
holiday workdays 2026-01

# 計算兩日期間的天數
holiday between <start> <end>
holiday between 2026-01-01 2026-01-31

其他命令

# 列出指定年份所有假期
holiday list <year>

# 顯示支援的年份範圍
holiday years

# 快取管理
holiday cache status        # 查看快取狀態
holiday cache clear         # 清除快取

# 設定管理
holiday config list         # 列出設定
holiday config get <key>    # 取得設定值
holiday config set <key> <value>  # 設定值

# 系統健康檢查
holiday health

# Shell 自動補全
holiday completion bash     # Bash
holiday completion zsh      # Zsh
holiday completion fish     # Fish

Output Formats

所有查詢命令都支援 -f, --format 選項:

# Simple 格式(預設)
holiday today
# 2026-01-04 (日) 是假期:週末

# JSON 格式
holiday today -f json
# {
#   "date": "2026-01-04",
#   "week": "日",
#   "isHoliday": true,
#   "description": ""
# }

# Table 格式
holiday today -f table
# ┌────────────┬──────┬──────────┬──────┐
# │ 日期       │ 星期 │ 是否假期 │ 說明 │
# ├────────────┼──────┼──────────┼──────┤
# │ 2026-01-04 │ 日   │ ✓        │ 週末 │
# └────────────┴──────┴──────────┴──────┘

設定預設格式:

holiday config set format json

Date Formats

支援多種日期格式:

| 格式 | 範例 | |------|------| | ISO | 2026-01-01 | | 斜線 | 2026/01/01 | | 無分隔 | 20260101 | | 相對日期 | today, tomorrow, yesterday | | 自然語言 | next monday, next friday |

Supported Years

目前支援 2017-2026 年的台灣假期資料。

holiday years
# 支援的年份範圍:2017-2026 (共 10 年)

Global Options

--no-cache    # 強制從 API 重新獲取,不使用快取
--help        # 顯示說明
--version     # 顯示版本

Shell Completion

Bash

holiday completion bash >> ~/.bashrc
source ~/.bashrc

Zsh

holiday completion zsh >> ~/.zshrc
source ~/.zshrc

Fish

holiday completion fish > ~/.config/fish/completions/holiday.fish

Data Source

假期資料來自 TaiwanCalendar 專案,感謝 @ruyut 的維護。

Development

# Clone
git clone https://github.com/lis186/taiwan-holiday-cli.git
cd taiwan-holiday-cli

# Install dependencies
npm install

# Development
npm run dev -- today

# Build
npm run build

# Test
npm test

# Test with coverage
npm run test:coverage

License

MIT License - see LICENSE for details.

Contributing

歡迎貢獻!請參閱 CONTRIBUTING.md