Luxon

Immutable, chainable date and time handling for JavaScript with built-in time zones and Intl.

Library
npm
v3.7.2
16,453 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 44
Maintenance 28
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 86
Code Quality 88
Innovation 90
Learning Curve 80

Luxon is a modern JavaScript library for working with dates, times, durations, and intervals. Built by a Moment.js maintainer, it offers an immutable, chainable API and relies on the platform’s native Intl support for time zones and localization, so there are no locale or time-zone data files to bundle.

It models the domain with distinct DateTime, Duration, Interval, and Info types, handles invalid values gracefully through a sentinel pattern rather than exceptions, and covers parsing and formatting for ISO, RFC 2822, HTTP, SQL, and custom token formats.

What You Get

  • Immutable DateTime, Duration, and Interval types with a fluent, chainable API
  • Native IANA time-zone support via the Intl API, with no bundled tz data
  • Parsing and formatting for ISO 8601, RFC 2822, HTTP, SQL, and custom token formats
  • Locale-aware formatting and human-readable relative time using Intl
  • A graceful invalid-value model that avoids throwing on bad input

Common Use Cases

  • Parsing and reformatting API timestamps across time zones
  • Displaying localized, human-friendly dates and relative times in UIs
  • Computing durations, differences, and calendar math between events
  • Scheduling logic that must respect a specific IANA time zone
  • Migrating away from the legacy, mutable Moment.js API

Under The Hood

Architecture

Luxon centers on four public types exported from src/luxon.js: DateTime (src/datetime.js), Duration (src/duration.js), Interval (src/interval.js), and the Info metadata facade (src/info.js). A Zone abstraction (src/zone.js) has concrete implementations for fixed offsets, IANA zones, the system zone, and an invalid zone under src/zones/. The heavy lifting lives in src/impl/, which separates concerns into a formatter, regexParser and tokenParser, calendar conversions (gregorian/week/ordinal), diff, locale, and shared util helpers, keeping the public types thin over well-isolated internals.

Tech Stack

The library is written in plain ES-module JavaScript with no runtime dependencies, leaning entirely on the platform Intl object for time-zone resolution and localization. It is transpiled with Babel and bundled with Rollup into ES6 (build/es6/luxon.mjs) and CommonJS (build/node/luxon.js) outputs via the tasks in tasks/. Testing uses Jest with coverage, and formatting is enforced with Prettier through lint-staged and Husky hooks.

Code Quality

The repository carries a substantial test suite of roughly 60 spec files under test/, mirroring the source layout (datetime, duration, interval, zones, impl). Error handling is deliberate: rather than throwing on bad input, operations produce ‘invalid’ sentinel values, with a small hierarchy of LuxonError subclasses in src/errors.js reserved for genuine misuse. Naming is consistent and the immutable design keeps functions pure and easy to reason about.

API Design The public API is a strong point: it is immutable and chainable, so expressions like DateTime.now().setZone('America/New_York').minus({ weeks: 1 }).endOf('day').toISO() read naturally. Method names are consistent and unambiguous, getting started requires almost no boilerplate, and the project ships extensive guides and generated API docs. TypeScript users consume separately published @types/luxon definitions rather than bundled types.

Used by 33 apps in this directory

TypeScript
53%
MIT

MentraOS

AI Development · Developer Tools

2,391

The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.

View details
92
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 53%
Java 16%
Updated 5 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 days ago
TypeScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,356

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 26%
JavaScript 24%
HTML 20%
Updated 6 days ago
TypeScript
81%
MIT

OpenCode

AI Code Assistants

220,711

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

View details
89
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 81%
MDX 16%
Updated 5 days ago
TypeScript
39%
AGPL 3.0

OpenObserve

Analytics · Devops · Monitoring

22,475

Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.

View details
90
Repo Health
9
Technical
68
Dependency
Built with
TypeScript 39%
Rust 30%
Vue 17%
Updated 5 days ago
TypeScript
91%
AGPL 3.0

OpenPanel

Analytics

7,187

Open-source Mixpanel alternative with session replay, MCP integration, and privacy-first product analytics you fully control.

View details
83
Repo Health
74
Technical
64
Dependency
Built with
TypeScript 91%
Updated 6 days ago
Ruby
78%
GPL 3.0

OpenProject

Collaboration · Productivity · Project Management

16,598

The open source project management platform that unifies Gantt charts, agile boards, time tracking, and team collaboration under full self-hosted control.

View details
96
Repo Health
79
Technical
69
Dependency
Built with
Ruby 78%
TypeScript 14%
Updated 5 days ago
TypeScript
54%
Other

OpenReplay

Analytics

13,042

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
91
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 54%
Go 13%
Updated 6 days ago
TypeScript
85%
MIT

openwork

AI Assistants · Automation

24,237

OpenWork is a free, open-source desktop app for running AI agent workflows on your own files with 50+ LLMs, extensible skills, and MCP server support — the open-source alternative to Claude Cowork and Codex.

View details
87
Repo Health
89
Technical
67
Dependency
Built with
TypeScript 85%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers