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

epochlens

v0.1.0

Published

A smart bidirectional timestamp inspector: paste any unix timestamp (s/ms/us/ns auto-detected) or date, see every representation. Zero dependencies.

Readme

epochlens

A smart, bidirectional timestamp inspector. Paste any unix timestamp — in seconds, milliseconds, microseconds or nanoseconds, auto-detected — or a date string, and see every representation at once. No flags to remember, no date -r vs date -d @ platform roulette.

npx epochlens 1718750000
#   input     1718750000  (unix seconds)
#
#   unix s    1718750000
#   unix ms   1718750000000
#   unix µs   1718750000000000
#   unix ns   1718750000000000000
#   iso utc   2024-06-18T22:33:20Z
#   iso local 2024-06-19T06:33:20+08:00
#   relative  2 minutes ago
#   rfc 2822  Tue, 18 Jun 2024 22:33:20 +0000

Zero dependencies. Also on PyPI (pip install epochlens) — the two builds produce byte-for-byte identical output.

Why

date can do this, but date -r 1718750000 (BSD/macOS) and date -d @1718750000 (GNU/Linux) are different commands, neither auto-detects whether you pasted seconds or milliseconds, and neither shows you all the forms at once. Online epoch converters do, but you have to leave the terminal and paste your data into someone else's website.

epochlens is the one command that just works on every platform, guesses the unit the way you'd expect, and goes both directions:

epochlens 1718750000123          # millis? micros? it figures it out
epochlens 2024-06-18T22:33:20Z   # date string -> every epoch precision
epochlens now                    # the current moment, all forms
echo 1718750000 | epochlens      # reads stdin too

Usage

epochlens <timestamp|date>
epochlens --unit ms 1718750000      # force the unit if the guess is wrong
epochlens --offset +05:30 1718750000  # add a row in a fixed UTC offset
epochlens --json 1718750000          # machine-readable

Auto-detection. A bare number is classified by magnitude: ~10 digits → seconds, ~13 → milliseconds, ~16 → microseconds, ~19 → nanoseconds. The detected unit is always echoed back so you can catch a wrong guess and re-run with --unit. A value with a decimal point is read as seconds.

Accepted input. Unix timestamps (any precision), ISO 8601 (2024-06-18T22:33:20Z, 2024-06-18 22:33:20, 2024-06-18, with or without a Z/±HH:MM offset), and RFC 2822 (Tue, 18 Jun 2024 22:33:20 +0000). A date string without an offset is read as UTC.

--json emits the unix values as strings so nanosecond precision survives (a 19-digit integer doesn't fit in a JSON/JS number):

{
  "input": "1718750000123",
  "detected": "unix milliseconds",
  "unix": { "s": "1718750000", "ms": "1718750000123", "us": "1718750000123000", "ns": "1718750000123000000" },
  "iso_utc": "2024-06-18T22:33:20.123Z",
  "iso_local": "2024-06-19T06:33:20.123+08:00",
  "iso_offset": null,
  "relative": "2 minutes ago",
  "rfc2822": "Tue, 18 Jun 2024 22:33:20 +0000"
}

Exit codes: 0 ok · 2 error (unparseable input, out-of-range date).

How it works

Date/time handling is a minefield of cross-platform and cross-language disagreements, so epochlens does none of its conversion through the runtime's date library. Date.parse, toISOString, fromisoformat and strftime all differ between (and within) Node and Python. Instead every conversion is plain integer arithmetic over a proleptic-Gregorian civil-day algorithm, and all formatting is hand-rolled. That's what lets the Node and Python builds stay byte-identical, and it's why nanosecond values stay exact (BigInt in Node, native ints in Python).

Scope

The MVP shows UTC, your machine's local time, and any fixed --offset. Named IANA zones (--tz America/New_York) are intentionally left out for now: Python's zoneinfo needs an OS tz database that Windows lacks, which would break the zero-dependency promise. Natural-language input ("3 days ago") is also out of scope — relative time is shown as output only.

Install

npm i -g epochlens   # or just npx epochlens
pip install epochlens  # Python build, identical behaviour

Node ≥ 18 or Python ≥ 3.8. No dependencies.

License

MIT