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

temporal-polyfill-lite

v0.4.3

Published

Lightweight Temporal polyfill

Readme

temporal-polyfill-lite

pkg.pr.new

Lightweight Temporal polyfill.

  • Small: The bundle size is nearly 10% smaller than temporal-polyfill, 60% smaller than @js-temporal/polyfill if you need only Gregorian calendar (see comparison for details).
  • Spec-compliant: It supports the latest spec, while other polyfills are based on the outdated spec (at least as of February 2026).

Usage

npm install temporal-polyfill-lite

For users who need only Gregorian calendar (iso8601 and gregory), you can use a smaller "basic" bundle:

// as a ponyfill (without patching global variables)
import { Intl, Temporal } from "temporal-polyfill-lite";

// load the polyfill to global
import "temporal-polyfill-lite/global";
// load types to global if you need (optional)
import "temporal-polyfill-lite/types/global";

// or you can manually install the polyfill
import { install } from "temporal-polyfill-lite/shim";
// overwrite native Temporal implementation
install(true);
// don't overwrite native Temporal implementation
install(false);

If you need other calendars (such as hebrew, chinese, or indian), you have to load a "full" bundle from temporal-polyfill-lite/calendars-full module instead of temporal-polyfill-lite.

import { Intl, Temporal } from "temporal-polyfill-lite/calendars-full";
import "temporal-polyfill-lite/calendars-full/global";
import { install } from "temporal-polyfill-lite/calendars-full/shim";

Temporal.Now.timeZoneId is very slow in the polyfill because there is no efficient way to get the system time zone (except native Temporal.Now.timeZoneId). temporal-polyfill-lite has an opt-in cache mechanism for this.

import { setSystemTimeZoneIdCacheTtl } from "temporal-polyfill-lite/shim";
// or use "temporal-polyfill-lite/calendars-full/shim" entrypoint if you use the "full" bundle

setSystemTimeZoneIdCacheTtl(1000);
// The result of `Temporal.Now.timeZoneId()` will be cached for a second

Browser support

The polyfill works in browsers after September 2020 by default (e.g. Safari 14). See docs/legacy.md if you want broader support.

TypeScript configuration

This polyfill provides type definitions out of the box (You don't need @types/*).

This package is ESM-only, so you have to set module and moduleResolution correctly. It also uses the exports field in package.json, so you should not set the resolvePackageJsonExports option to false in your tsconfig.json. Otherwise the type resolution will fail.

Spec compliance

It supports the latest spec with few intentional deviations (see tests/expectedFailures directory for details).

Docs