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

timezone-overlap-map

v0.2.0

Published

A web component that shows two timezones and how their working hours overlap

Readme

timezone-overlap-map

A web component that shows your timezone next to your visitor's on a world map, and how your working hours overlap. Built with React and TypeScript, shipped as a standard custom element, so it works in any framework or in plain HTML.

  • A world map read as your day, 00 to 24: your working hours stay put, the visitor's slide with their zone, and the overlap is labeled with its length ("5 h").
  • A dot per city and the live day/night line with the sun's position.
  • Both clocks, a zone picker that starts at the visitor's zone, and the overlap in the visitor's own time as text (also for screen readers).

About 15 KB gzipped, map included, plus React.

Install

npm install timezone-overlap-map react react-dom

React is a peer dependency: your bundler provides it.

Usage

import 'timezone-overlap-map';
<timezone-overlap-map
  home-zone="America/Argentina/Buenos_Aires"
  home-label="Santiago"
></timezone-overlap-map>

The visitor's zone comes from the browser (Intl), with no IP lookup. A selector lets them pick another one, for example a recruiter hiring for a team in a different zone.

Attributes

| Attribute | Default | | |---|---|---| | home-zone | UTC | IANA zone you work from | | home-label | city of home-zone | Name shown for your side | | visitor-zone | the browser's zone | Starting zone for the visitor | | work-start | 9 | Start of working hours, local time in each zone | | work-end | 18 | End of working hours (a value before work-start means a night shift) | | lang | the closest lang up the tree | en or es; any other language falls back to English |

The language is read when the element renders and whenever its own attributes change; if you switch the page's <html lang> on the client, set lang on the element too.

Offsets are computed with Intl for the current date, so daylight saving time on either side is always right.

Events

zonechange fires when the visitor picks another zone:

el.addEventListener('zonechange', (event) => console.log(event.detail.zone));

Theming

Styles live in the shadow DOM. Custom properties cross it, so set them on the element or any ancestor:

timezone-overlap-map {
  --tom-fg: #e8e6e3;
  --tom-muted: #9a9894;
  --tom-track: #ffffff1a;
  --tom-home: #4fd1c5;
  --tom-visitor: #f6ad55;
  --tom-overlap: #68d391;
  --tom-land: #ffffff38;
  --tom-night: #00000066;
  --tom-sun: #fff7d6;
  --tom-radius: 4px;
  --tom-font: 14px/1.5 system-ui;
}

The night and the sun have defaults for both light and dark pages, picked through the page's color-scheme.

Server rendering

Importing the package on the server is safe: the element registers only where customElements exists.

Development

yarn
yarn dev       # demo page at http://localhost:5173
yarn test
yarn build     # dist/: ES module + type declarations
yarn geo       # regenerate src/geo.ts (map outline + zone coordinates)

Releasing

Push a v* tag matching version in package.json; the Release workflow tests, builds and publishes to npm with provenance, through npm trusted publishing (no token stored in the repo).

npm version patch   # bumps package.json and creates the tag
git push --follow-tags

Data

Both are converted once by scripts/build-geo.mjs into a compact SVG path and a coordinate table; the package has no runtime dependencies besides React.

License

MIT