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

@ohmyperf/viewer

v0.1.1

Published

Static, single-file HTML viewer for OhMyPerf Reports (no runtime dependencies; no React in v0).

Readme

@ohmyperf/viewer

Static single-file HTML viewer for OhMyPerf Reports. No runtime dependencies. No React. No JS framework. Just a string-returning function that emits a self-contained HTML document with inline CSS, inline SVG charts, and an inert JSON payload.

Usage

import { renderReportHtml } from "@ohmyperf/viewer";

const html = renderReportHtml(report, {
  title: "Weekly perf — example.com",
  theme: "system",
});

Default reporter for the CLI: ohmyperf run --format json,html produces report.html next to report.json.

Subpath exports

The package exposes three entry points:

import { renderReportHtml } from "@ohmyperf/viewer";
import { renderDonut, renderCwvCard, renderHorizontalBars, classifyCwv, CWV_THRESHOLDS } from "@ohmyperf/viewer/charts";
import { escapeHtml, safeUrl, safeNumeric } from "@ohmyperf/viewer/escape";
  • @ohmyperf/viewer — main viewer entry (renderReportHtml)
  • @ohmyperf/viewer/charts — hand-rolled inline SVG chart primitives, framework-agnostic
  • @ohmyperf/viewer/escape — HTML/URL/numeric escape helpers used in all rendering surfaces

@ohmyperf/reporter-deck consumes the /charts and /escape subpaths.

Visual sections

See docs/beautiful-report.md for the full guide.

| Section | Contents | |---|---| | Hero | URL, mode, runs, browser, host, measurement ID | | CWV traffic-light grid | LCP, INP, CLS, FCP, TTFB, TBT — color + icon + text | | Attribution | LCP element, INP interaction, etc. (when captured) | | Third parties | Donut + entity legend (when pluginData.thirdParties populated) | | Audits | Pass/fail table (or empty-state) | | Resources | Sorted by response time | | Frame tree | OOPIF detection + cross-origin markers | | Runs | Per-run breakdown | | Plugin data | Collapsible <details> for pluginData[*] | | Raw JSON | Full Report payload via <script type="application/json" id="ohmyperf-report-payload"> |

When a section's data is empty, an empty-state card with positive copy is rendered (not silently hidden).

Theme

renderReportHtml(report, { theme: "light" });
renderReportHtml(report, { theme: "dark" });
renderReportHtml(report, { theme: "system" });

Palette + design tokens

Tokens are imported from @ohmyperf/design-tokens, which reflects the canonical apps/website/app/globals.css. Drift is gated by scripts/check-design-tokens.mjs in CI.

Every OKLCH declaration has a hex fallback ahead of it for stale-browser safety:

--color-primary: #1855b8;
--color-primary: oklch(0.50 0.18 245);

Self-contained

The output HTML opens with <meta name="referrer" content="no-referrer"> and makes zero external HTTP requests when opened. System font stack only. No Google Fonts. No CDN. Safe to email, archive, or open offline.

License

Apache-2.0.