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

stalescope

v0.1.0

Published

Next.js App Router cache inspector and debug dashboard. Make the invisible cache visible.

Readme

stalescope

Next.js App Router cache inspector. Drop it in, visit /__stalescope, see exactly which cache layer served every request — live.

Why

Next.js has four separate cache layers. The only built-in debug tool is NEXT_PRIVATE_DEBUG_CACHE — a raw env var dumping unstructured console logs. When your page shows stale data, you have no structured way to see which layer is responsible.

stalescope instruments your fetch calls and revalidations, stores the events in a ring buffer, and renders a live dashboard inside your own app.

Install

npm install stalescope

Setup (two files)

instrumentation.ts (project root):

import { withStalescope } from 'stalescope'
withStalescope()

app/%5F%5Fstalescope/[[...path]]/route.ts:

export { GET, DELETE } from 'stalescope/dashboard'

Next.js treats folders starting with _ as private, non-routable segments — %5F is the URL-encoded underscore, and this folder name maps to the /__stalescope URL at request time.

Visit http://localhost:3000/__stalescope — done.

What you see

  • Every fetch() call with status (HIT / MISS / REVALIDATE / SKIP), cache layer, duration, and URL
  • Every revalidatePath and revalidateTag call
  • Heap usage trend chart — helps correlate memory growth with specific fetch patterns (relevant to the known standalone mode memory leak in Next.js 14-16)
  • Live SSE feed — updates without page refresh
  • Filter by status, layer, or revalidation type

Options

withStalescope({
  enabled:      true,           // default: NODE_ENV !== 'production'
  maxEvents:    500,            // ring buffer size
  trackMemory:  true,           // log heapUsed per event
  mountPath:    '/__stalescope' // dashboard URL
})

Security

Disable in production (the default). The dashboard exposes internal cache state and heap metrics — not suitable for public exposure.

Related issues

This package was built in response to these open Next.js issues:

  • #90433 — Memory leak causing OOM in standalone + fetch
  • #85914 — Memory leak Node 22 + fetch + output: standalone
  • #75314 — Excessive caching causes memory leak
  • #75686 — Memory leak in standalone mode via dedupeFetch
  • #68636 — Possible memory leak in Fetch API
  • #26801 — Memory leak in Kubernetes (5 years of reports)

License

MIT