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
isBeforeisAftercompare datesisSameisBetweenequality & rangeclampisWeekendchecks
🧮 Arithmetic
addsubtractadd/sub timestartOfendOfstart/end unitnextDayaddBusinessDayshelpers
🛡️ Guards & Types
isPlainDateisInstantisDurationisZonedDateTimeisPlainYearMonthisPlainMonthDayisDateLike
🌐 Formatting & Convert
formatlocalized stringformatRelativerelative timetoZonedDateTimeconvert zone
📦 Collections
sortAscsortDescsort datesclosestTofind nearesteachDayOfIntervalmake range
🔧 Functional
pipechain functionscomposecombine functionsnowfromISOhelpers