Socket
Book a DemoInstallSign in
Socket

kenya-holidays

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kenya-holidays

A simple package to retrieve all Kenyan public holidays for a given year

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

Kenya Holidays

A simple npm package to get all Kenyan public holidays for a given year.

Installation

npm install kenya-holidays

Usage

Basic Usage

const { getKenyanHolidays } = require('kenya-holidays');

// Get holidays for the current year
const holidays = getKenyanHolidays();
console.log(holidays);

// Get holidays for a specific year
const holidays2024 = getKenyanHolidays(2024);
console.log(holidays2024);

// Get formatted dates (YYYY-MM-DD)
const formattedHolidays = getKenyanHolidays(null, true);
console.log(formattedHolidays);

Detailed Holiday Information

const { getDetailedKenyanHolidays } = require('kenya-holidays');

// Get detailed holiday information for the current year
const detailedHolidays = getDetailedKenyanHolidays();
console.log(detailedHolidays);

// Example output:
// [
//   {
//     name: "New Year's Day",
//     date: "2025-01-01",
//     type: "National",
//     description: "Celebrates the start of the new year",
//     isVariable: false
//   },
//   ...
// ]

Check if a Date is a Holiday

const { isKenyanHoliday } = require('kenya-holidays');

// Check if a specific date is a holiday
const holiday = isKenyanHoliday('2025-12-25');
if (holiday) {
  console.log(`${holiday.date} is ${holiday.name} (${holiday.type})`);
  console.log(`Description: ${holiday.description}`);
} else {
  console.log('Not a holiday');
}

// You can also pass a Date object
const dateObj = new Date(2025, 11, 25); // December 25, 2025
const christmasHoliday = isKenyanHoliday(dateObj);
console.log(christmasHoliday); // Returns holiday info

Features

  • Get all Kenyan public holidays for any year (past, present, or future)
  • Accurately calculates Easter-based holidays (Good Friday, Easter Monday) for any year
  • Option to get dates in JavaScript Date objects or formatted strings
  • Notes for variable Islamic holidays (Eid al-Fitr, Eid al-Adha)
  • Detailed holiday information including type and description
  • Flexible API with both simple and detailed output formats

Holiday List

The package includes the following Kenyan public holidays:

  • New Year's Day - January 1
  • Good Friday - Variable date (calculated)
  • Easter Monday - Variable date (calculated)
  • Labour Day - May 1
  • Madaraka Day - June 1
  • Huduma Day - October 10
  • Mashujaa Day - October 20
  • Jamhuri Day - December 12
  • Christmas Day - December 25
  • Boxing Day - December 26
  • Utamaduni Day - December 27
  • Eid al-Fitr* - Variable date (Islamic calendar)
  • Eid al-Adha* - Variable date (Islamic calendar)
  • Diwali* - Variable date (sometimes declared a public holiday)

*Note: Islamic holidays depend on the lunar calendar and may vary. The package provides a note for these dates rather than calculating them.

License

MIT

Keywords

kenya

FAQs

Package last updated on 02 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.