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

@catlabtech/mycal-sdk

v0.1.1

Published

TypeScript client SDK for the Malaysia Calendar API — public holidays, school calendar, business day calculator

Downloads

202

Readme

@catlabtech/mycal-sdk

TypeScript client SDK for the Malaysia Calendar API — public holidays, school calendar, exam schedules, and business day calculator for all 16 states + 3 Federal Territories.

Data sourced from the official Malaysian government gazette (JPM BKPP), JAKIM, KPM, and MPM.

Install

npm install @catlabtech/mycal-sdk
# or
pnpm add @catlabtech/mycal-sdk

Node 18+. ESM only. Uses platform fetch.

Quick start

import { MyCalClient } from "@catlabtech/mycal-sdk";

const cal = new MyCalClient();

// Is March 21, 2026 a working day in Selangor?
const result = await cal.check("2026-03-21", "selangor");

if (result.success) {
  console.log(result.data.isWorkingDay);       // false (it's Hari Raya Aidilfitri)
  console.log(result.data.holidays[0].name.en); // "Eid al-Fitr"
} else {
  console.error(result.error.code, result.error.message);
}

No signup, no API key. The client defaults to the public production API.

Why a Result pattern?

Every async method returns Result<T> — a tagged union of success or error. The compiler forces you to handle errors before accessing data, which means no forgotten try/catch, no unexpected exceptions.

type Result<T> =
  | { success: true; data: T }
  | { success: false; error: { code: string; message: string; status: number } };

If you prefer classic exceptions, wrap the client with a one-line unwrap() helper (example in docs).

What you get

Holidays

await cal.holidays({ year: 2026, state: "kl" });            // list
await cal.holidaysToday("selangor");                        // today's status
await cal.holidaysNext({ state: "penang", limit: 3 });      // next N upcoming
await cal.holidaysBetween("2026-03-01", "2026-03-31", "kl"); // range
await cal.check("2026-03-21", "selangor");                  // single date

Business days (state-aware)

await cal.businessDays("2026-03-01", "2026-03-31", "selangor");
await cal.addBusinessDays("2026-03-01", 10, "selangor");

Respects Kumpulan A (Kedah/Kelantan/Terengganu use Fri–Sat) vs Kumpulan B weekends, plus state-level public holidays.

School calendar

await cal.schoolTerms({ year: 2026, group: "B" });
await cal.schoolHolidays({ year: 2026, state: "selangor" });
await cal.exams({ year: 2026, type: "spm" });
await cal.isSchoolDay("2026-03-21", { state: "selangor" });

States

await cal.states();                       // all 16 states + 3 FTs
await cal.resolveState("kl");             // alias → canonical code

iCal feed URL

cal.icalUrl("selangor", 2026);            // formatted URL for subscription

Features

  • 16 states + 3 Federal Territories with correct weekend config
  • Smart aliaseskl, jb, penang, n9, kk — all auto-resolve
  • Cuti ganti — replacement holidays auto-calculated
  • Trilingual — every holiday has Bahasa Melayu, English, and Chinese (中文) names
  • Gazette references — every record links back to the official Warta Kerajaan
  • Islamic calendar — Hijri dates from JAKIM Takwim
  • School calendar — KPM terms, cuti penggal, cuti perayaan for Kumpulan A and B
  • Exam dates — SPM, STPM, MUET, PT3

Documentation

Full API reference, examples, and guides: https://mycal-web.pages.dev/docs

Try the interactive demo: https://mycal-web.pages.dev/demo

Related packages

License

MIT — © catlab.tech

Issues and contributions: github.com/Junhui20/malaysia-calendar-api