Ready for the future of JavaScript dates

A lightweight, tree-shakable library for JavaScript's Temporal API. Functional design, full TypeScript support, and zero dependencies.

npm install temporal-kit

Functional & Composable

Build complex logic with pipe and compose. Data-last design for better readability.

Tree-Shakable

Modular architecture. Import only what you need, keep your bundle size tiny.

Type-Safe

Written in TypeScript with strict mode. Catch errors at compile time, not runtime.

Future-Proof

Built directly on the ECMAScript Temporal API. No proprietary date objects to learn.

Locale-Aware

Leverages Intl for robust, localized date formatting and relative time strings.

Universal

Runs anywhere JavaScript runs. Works with native Temporal or any standard polyfill.

API Overview

A quick look at the available utilities.

🔍 Comparison & Range

  • isBefore isAfter compare dates
  • isSame isBetween equality & range
  • clamp isWeekend checks

🧮 Arithmetic

  • add subtract add/sub time
  • startOf endOf start/end unit
  • nextDay addBusinessDays helpers

🛡️ Guards & Types

  • isPlainDate isInstant isDuration
  • isZonedDateTime isPlainYearMonth
  • isPlainMonthDay isDateLike

🌐 Formatting & Convert

  • format localized string
  • formatRelative relative time
  • toZonedDateTime convert zone

📦 Collections

  • sortAsc sortDesc sort dates
  • closestTo find nearest
  • eachDayOfInterval make range

🔧 Functional

  • pipe chain functions
  • compose combine functions
  • now fromISO helpers