/temporal

A lightweight Temporal polyfill and other futuristic JavaScript date utilities.

Primary LanguageJavaScript

Temporal Monorepo

A lightweight Temporal polyfill and other futuristic JavaScript date utilities.

Project Updates

  • 2023-04-22: The codebase is undergoing a refactor to respond to the lastest changes in the Temporal spec. This refactor will also improve minification size, performance, and conformance to TC39 tests. Please subscribe to this ticket for updates.
  • 2023-09-12: The refactor is going well. A number of bugfixes and bundle-size optimizations are outstanding.

temporal-polyfill

A spec-compliant polyfill in 16kb.

npm install temporal-polyfill

A) Import globally:

import 'temporal-polyfill/global'

console.log(Temporal.Now.zonedDateTimeISO().toString())

B) Import as an ES module without side effects:

import { Temporal } from 'temporal-polyfill'

console.log(Temporal.Now.zonedDateTimeISO().toString())

Read more about temporal-polyfill

Repo Dev Commands

pnpm build
pnpm watch
pnpm test --watch
pnpm test --coverage
pnpm lint
pnpm size