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

mxdvl

v0.0.1

Published

my personal library

Readme

ReadonlyDate

Immutable date wrapper that exposes only UTC getter methods—no setters, no timezone confusion.

Note: This is a temporary patch to ensure immutability when working with dates. For new projects, prefer the Temporal API which provides proper immutable date/time handling built into the language.

Why?

When working with dates across timezones, it's easy to introduce bugs through:

  • Accidental mutations via setter methods
  • Timezone-dependent getters that vary by location
  • Inconsistent date handling in distributed systems

ReadonlyDate solves this by providing a strict subset of the Date API.

Usage

import { ReadonlyDate } from "./lib/readonly-date.js";

// Constructor accepts:
// 1. A timestamp in milliseconds
const date1 = new ReadonlyDate(1706358896789);

// 2. Year, month, and day (UTC)
const date2 = new ReadonlyDate(2024, 0, 27); // January 27, 2024

// ✓ UTC getters work
date2.getUTCFullYear(); // 2024
date2.getUTCMonth(); // 0 (January)
date2.getUTCDate(); // 27
date2.getTime(); // 1706313600000

// ✓ String conversions
date2.toISOString(); // "2024-01-27T00:00:00.000Z"
date2.toUTCString(); // "Sat, 27 Jan 2024 00:00:00 GMT"

// ✗ No setters exist
date2.setUTCFullYear; // undefined (property doesn't exist)
date2.setTime; // undefined

// ✗ No local timezone methods
date2.getFullYear; // undefined (property doesn't exist)
date2.getMonth; // undefined

API

All methods mirror the standard Date API but restricted to UTC operations:

Time components:

  • getUTCFullYear() → year (4 digits)
  • getUTCMonth() → month (0-11, where 0 = January)
  • getUTCDate() → day of month (1-31)
  • getUTCDay() → day of week (0-6, where 0 = Sunday)
  • getUTCHours() → hours (0-23)
  • getUTCMinutes() → minutes (0-59)
  • getUTCSeconds() → seconds (0-59)
  • getUTCMilliseconds() → milliseconds (0-999)

Timestamps & conversions:

  • getTime() → milliseconds since Unix epoch
  • valueOf() → same as getTime()
  • toISOString() → ISO 8601 string (YYYY-MM-DDTHH:mm:ss.sssZ)
  • toUTCString() → human-readable UTC string
  • toJSON() → same as toISOString()

Design

ReadonlyDate wraps a native Date in a private field, exposing only UTC methods through a minimal interface. This ensures:

  • Immutability – no setters means dates can't change
  • Consistency – UTC-only methods eliminate timezone ambiguity
  • Simplicity – smaller API surface reduces cognitive load

Perfect for APIs, data serialization, and distributed systems where dates must remain stable and timezone-independent.