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

ph-holidays

v0.1.2

Published

A trusted and complete holiday calendar for the Philippines with long weekend detection and auto-updated data from official sources.

Downloads

12

Readme

🇵🇭 ph-holidays

"Know when to pahinga." A trusted and complete holiday calendar for the Philippines — with support for regular and special holidays, long weekend detection, and automated updates from official government sources.


✨ Features

  • 🗆️ getHolidays(year) — Get all holidays for a given year
  • isHoliday(date) — Check if a specific date is a holiday
  • 🧠 getHolidayInfo(date) — Retrieve name, type, and source of holiday
  • 📉 getLongWeekends(year) — Identify long weekends (3+ days off)
  • 💻 CLI-ready: npx ph-holidays
  • --update flag scrapes and refreshes data for a given year
  • 🧉 Smart merge: updates only the selected year's data in holidays.json
  • 🥪 Unit-tested with Jest for core logic
  • 📁 Structured data/ folder for clean JSON records per year
  • ✨ Supports Node.js >= 14 and modern ES modules

📦 Installation

Install via NPM:

npm install ph-holidays

Or use instantly with NPX:

npx ph-holidays 2025

🖥️ CLI Usage

npx ph-holidays 2025                   # Show all holidays for 2025
npx ph-holidays 2025 --long-weekends   # Show only long weekends
npx ph-holidays 2024 --update          # Scrape and update only 2024 data

👉 The --update flag fetches official holidays directly from officialgazette.gov.ph and updates only the specified year in data/holidays.json.


🧑‍💻 JavaScript Usage

import {
  getHolidays,
  getLongWeekends,
  isHoliday,
  getHolidayInfo
} from 'ph-holidays';

console.log(getHolidays(2025));
console.log(getLongWeekends(2025));
console.log(isHoliday('2025-12-25')); // true
console.log(getHolidayInfo('2025-12-25')); // { name: 'Christmas Day', type: 'Regular', ... }

⚠️ If you're using Node.js and importing JSON, ensure holidays.json is loaded via createRequire:

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const holidaysData = require('../data/holidays.json');

📂 Folder Structure

ph-holidays/
├── data/                    # JSON holiday data by year
├── src/                     # Holiday logic and utility functions
├── cli/                     # Command-line interface entry
├── tools/                   # Scraper (puppeteer + cheerio)
├── tests/                   # Jest unit tests
├── .github/workflows/       # Auto-update via GitHub Actions

↺ Update Strategy

| Method | Description | | ------------- | ------------------------------------------------------------------------------------------ | | Manual | ✅ Current Method — Run npx ph-holidays 2024 --update to pull new data from the Gazette | | Automated | (Planned) GitHub Actions scraper to run monthly to check for new proclamations | | Selective | Only the passed year is refreshed in holidays.json, leaving others intact | | Verified | Every holiday has a source field referencing the Gazette |

ℹ️ Note: The update process is manual as of now. GitHub Actions automation will be added in a future release.


📚 Official Source

Holiday data is obtained directly from the following official government resource:


⚠️ Disclaimer

This project is not affiliated with any government agency. All data is publicly sourced from official sites for civic, educational, and development use.

As per RA 8293 (Intellectual Property Code), Section 176.1, no copyright subsists in official government documents.


⚖️ License

MIT — Free for public, academic, and commercial use. Use it, fork it, improve it — responsibly.


🤝 Contributing

Pull requests are welcome!

If you:

  • spot a parsing issue,
  • need support for a new feature,
  • want to enhance long weekend logic,

...please open an issue or submit a PR 🙌


Happy coding — and happy holidays! 🇵🇭