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

@esm-repacks/dayjs

v1.11.24

Published

Proper ESM repack of dayjs with subpath exports for plugins and locales

Readme

@esm-repacks/dayjs

A proper ESM repack of dayjs with a complete package.json exports map, exposing all plugins and locales as first-class subpath exports.

Credits

All credit for the underlying library goes to the dayjs authors and contributors. This package is a thin redistribution layer — it does not modify any dayjs logic, only adds the missing exports map and ensures the published ESM files are discoverable by modern tooling.

  • dayjs is licensed under the MIT License
  • dayjs repository: https://github.com/iamkun/dayjs

Why does this exist?

dayjs ships ESM files under dayjs/esm/ but does not expose them via "exports" in its package.json. This means:

  • Node.js ESM resolution cannot find them without deep path hacks
  • Bundlers that respect the "exports" field cannot tree-shake correctly
  • TypeScript subpath plugin imports like dayjs/plugin/utc resolve to CJS files instead of ESM

This package fixes all of the above by providing a proper "exports" map over the existing dayjs ESM output.

Installation

npm install @esm-repacks/dayjs
pnpm add @esm-repacks/dayjs
yarn add @esm-repacks/dayjs

Usage

Core

import dayjs from "@esm-repacks/dayjs";

const now = dayjs();
console.log(now.format("YYYY-MM-DD"));

Plugins

import dayjs from "@esm-repacks/dayjs";
import utc from "@esm-repacks/dayjs/plugin/utc";
import timezone from "@esm-repacks/dayjs/plugin/timezone";
import relativeTime from "@esm-repacks/dayjs/plugin/relativeTime";

dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.extend(relativeTime);

dayjs.utc("2024-01-01T12:00:00Z").tz("America/New_York").format();
dayjs("2024-01-01").fromNow();

All 37 official dayjs plugins are available under @esm-repacks/dayjs/plugin/<name>:

advancedFormat · arraySupport · badMutable · bigIntSupport · buddhistEra · calendar · customParseFormat · dayOfYear · devHelper · duration · isBetween · isLeapYear · isMoment · isSameOrAfter · isSameOrBefore · isToday · isTomorrow · isYesterday · isoWeek · isoWeeksInYear · localeData · localizedFormat · minMax · negativeYear · objectSupport · pluralGetSet · preParsePostFormat · quarterOfYear · relativeTime · timezone · toArray · toObject · updateLocale · utc · weekOfYear · weekYear · weekday

Locales

import dayjs from "@esm-repacks/dayjs";
import "@esm-repacks/dayjs/locale/fr";
import "@esm-repacks/dayjs/locale/de";
import "@esm-repacks/dayjs/locale/ja";

dayjs.locale("fr");
dayjs("2024-06-15").format("dddd"); // 'samedi'

All 143 official dayjs locales are available under @esm-repacks/dayjs/locale/<code>.

TypeScript

Type declarations are included. Importing a plugin adds its type augmentation to Dayjs and the dayjs factory. Call dayjs.extend(plugin) to install the plugin at runtime.

import dayjs from "@esm-repacks/dayjs";
import type { Dayjs } from "@esm-repacks/dayjs";
import utc from "@esm-repacks/dayjs/plugin/utc";

dayjs.extend(utc);

const d: Dayjs = dayjs();
d.utc();

Dayjs is a type-only export. Plugins that are not imported do not contribute their instance or static methods to the types.

TypeScript module resolution

Core, plugins, and locales support these resolver settings:

| Use | module | moduleResolution | |---|---|---| | Bundler | ESNext | bundler | | Node.js | Node16 | node16 | | Node.js | NodeNext | nodenext |

For native Node.js ESM, for example:

{
    "compilerOptions": {
        "module": "NodeNext",
        "moduleResolution": "nodenext"
    }
}

Set "type": "module" in your application's package.json, or use .mts source files, so TypeScript treats your Node.js code as ESM.

The legacy "moduleResolution": "node" resolver does not support the package's subpath exports. Use one of the settings above. Locale declarations resolve only for exported locales; standalone locale imports also work without importing core.

Versioning

This package uses independent semantic versions so repack fixes can ship between dayjs releases. The published package.json records the bundled dayjs version in upstreamVersion.

A daily automated workflow checks for new dayjs releases and publishes updated repacks. An upstream patch, minor, or major update applies the corresponding bump to the repack's current version. For example, a repack fix can release as 1.11.24 with dayjs 1.11.23; the next upstream 1.11.24 then ships in repack 1.11.25.

License

MIT — see LICENSE.

The repackaged dayjs source is also MIT — see the dayjs license.