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

@iterumarchive/neo-calendar-core

v0.1.1

Published

Core calendar engine for NeoCalendar - types, interfaces, and base plugin system

Readme

@iterumarchive/neo-calendar-core

Core engine for NeoCalendar - types, interfaces, and base plugin system

npm version Bundle Size Status

⚠️ Beta Software - Internal APIs may change before v1.0. Intended for package development.

Overview

The Core package provides the foundational types, interfaces, and base plugin system that all NeoCalendar packages build upon. Most users do not need to install this package directly - it's included as a dependency of the Standard and Full packages.

When to Use This Package

Install @iterumarchive/neo-calendar-core if you are:

  • Building a custom calendar plugin
  • Creating a framework that extends NeoCalendar
  • Need only the type definitions without the API layer

For general calendar conversions, use @iterumarchive/neo-calendar (Standard) or @iterumarchive/neo-calendar-full (Full) instead.

Installation

npm install @iterumarchive/neo-calendar-core

What's Included

Type System

  • JDN - Julian Day Number (bigint)
  • BrandedJDN - Type-safe JDN wrapper
  • DateRecord - Calendar date representation
  • CalendarSystemId - Calendar identifier enum
  • EraLabel - Era suffix types (AD, BC, HE, etc.)

Interfaces

  • ICalendarPlugin - Plugin contract for calendar implementations
  • ICalendarRegistry - Registry interface
  • IAdjustmentEngine - Administrative adjustment system

Base Classes

  • BaseCalendarPlugin - Abstract base class for plugins
  • AdjustmentEngine - Handles historical discontinuities
  • AdvancedFeatures - Observational data and metadata

Error Classes

  • CalendarError - Base error class
  • RegistryError - Registry-related errors
  • ValidationError - Date validation errors
  • ConversionError - Conversion failures
  • EraError - Era-related errors
  • ArithmeticError - Arithmetic operation errors

Usage Example: Building a Custom Plugin

import { 
  BaseCalendarPlugin, 
  CalendarSystemId, 
  DateRecord, 
  JDN,
  EraLabel
} from '@iterumarchive/neo-calendar-core';

export class MyCustomPlugin extends BaseCalendarPlugin {
  readonly id = 'MY_CUSTOM' as CalendarSystemId;
  readonly name = 'My Custom Calendar';
  readonly eraLabels: EraLabel[] = ['MC'];

  dateToJDN(date: DateRecord): JDN {
    // Your conversion logic here
    return 0n;
  }

  jdnToDate(jdn: JDN): DateRecord {
    // Your conversion logic here
    return {
      year: 0,
      month: 1,
      day: 1,
      calendarId: this.id
    };
  }

  isValid(date: DateRecord): boolean {
    // Your validation logic here
    return true;
  }

  getDaysInMonth(year: number, month: number): number {
    // Your month length logic here
    return 30;
  }

  getDaysInYear(year: number): number {
    // Your year length logic here
    return 365;
  }
}

API Reference

Core Types

// Julian Day Number (bigint)
type JDN = bigint;

// Date representation
interface DateRecord {
  year: number;
  month: number;
  day: number;
  calendarId: CalendarSystemId;
  era?: EraLabel;
}

// Calendar system identifiers
enum CalendarSystemId {
  GREGORIAN = 'GREGORIAN',
  JULIAN = 'JULIAN',
  HEBREW = 'HEBREW',
  ISLAMIC = 'ISLAMIC',
  // ... etc
}

Plugin Interface

interface ICalendarPlugin {
  readonly id: CalendarSystemId;
  readonly name: string;
  readonly eraLabels: EraLabel[];
  
  dateToJDN(date: DateRecord): JDN;
  jdnToDate(jdn: JDN): DateRecord;
  isValid(date: DateRecord): boolean;
  getDaysInMonth(year: number, month: number): number;
  getDaysInYear(year: number): number;
}

Bundle Size

  • Minified: ~5kb
  • Gzipped: ~2kb
  • 0 runtime dependencies

Documentation

License

MIT