Ten Thousand Packages, Five Surprises: A Random Walk Through the npm Registry
Photo: anonymous, CC0, via Wikimedia Commons
npm has north of two million packages. Almost everything written about it is either a horror story about one malicious package or a love letter to the top 100. Almost nothing looks at the middle — the vast, quiet bulk of the registry where most packages actually live.
So I did what I tend to do when a dataset is too big to reason about: I sampled. A uniform random draw of 10,000 packages from the registry, fetched via the public registry API (respectfully, with rate limiting — the registry team does not need me as an incident), then five analysis passes. Each pass surfaced something that surprised me. Hence: five dips.
The full notebook is linked at the bottom. Everything here is reproducible against live data, and I'd genuinely encourage you to rerun it — my numbers are a snapshot, not scripture.
Dip 1: The Registry Is Older Than Its Reputation Suggests
The common caricature of npm is a churning sea of abandoned experiments. The last-publish dates tell a more nuanced story. In my sample, roughly 60% of packages had published something within the last year. But the distribution is heavily bimodal: there's a big hump of actively maintained packages and a long, flat plateau of packages whose last publish was 3+ years ago, with surprisingly little in between.
Packages tend to be either clearly alive or clearly dormant. The "zombie shuffling along" middle — updated just often enough to look maintained — is thinner than I expected. That's actually good news for npm audit: staleness is a sharper signal than it looks, because there's little gray zone to hide in.
Dip 2: Most Packages Have Exactly One Maintainer
This was the dip that changed how I think about supply chain risk. The maintainer-count distribution is brutally concentrated: the modal package has exactly one maintainer, and the median isn't much better. Multi-maintainer packages are the exception, not the rule — and the handful of packages with 10+ maintainers are almost all famous infrastructure pieces.
The practical read: bus factor isn't an edge case in the ecosystem, it's the default state. When we talk about "maintainer burnout" in open source, we're often talking about the single person holding up thousands of dependent projects. If you maintain a widely depended-on package and you're the only one with publish rights, this data is your permission slip to recruit a co-maintainer.
Dip 3: The Open Issue Ratio Has a Natural Ceiling
I computed, for each package, the ratio of open to total issues. My hypothesis: well-maintained packages would have low open ratios (they close things promptly). The data half-agreed.
Active packages did show lower open ratios — but the ratio plateaus around 20–30% for almost everyone, regardless of project size. Below that, you're looking at either a heroic maintainer or a project where issues get closed en masse. Above roughly 70%, the sample was dominated by dormant packages. In other words, the ratio is a decent dormancy detector but a weak quality detector. I've stopped using it the way I used to.
Dip 4: Licensing Is Boring in the Best Way
MIT dominates my sample by a wide margin, with ISC a strong second — no surprise, since npm init defaults have pushed both. The interesting wrinkle: a nontrivial tail of packages have no license field at all or use nonstandard license strings that don't parse. If you're doing license compliance at work, your tooling almost certainly mishandles that tail, because the tail is messy free-text, not clean SPDX identifiers.
Estimated share of the sample with unparseable license metadata: low single digits, but nonzero, and concentrated in older, dormant packages — the exact packages most likely to be quietly deep in a dependency tree somewhere.
Dip 5: The Sample Keeps Moving Underneath You
The most methodological surprise: rerunning the same notebook two weeks apart produced noticeably different numbers for time-since-last-publish. Of course it does — the registry is a living thing. But it drove home a point I'd glossed over: any "ecosystem health" statistic is really a statistic about a moment. Trend lines require repeated sampling, which is exactly what the notebook's design supports. Point-in-time numbers make good blog posts; repeated samples make good decisions.
Run It Yourself
The notebook does four things: draws a uniform sample via the registry's bulk metadata endpoints, fetches per-package details with polite rate limiting, computes the metrics above, and caches everything to a local parquet file so reruns don't re-hit the API. Total runtime for a fresh sample is about 20 minutes; cached analysis is seconds.
A few notes if you do: sample uniformly, not by downloads — download-ranked samples just re-measure the top 500 with extra steps. And cache aggressively; the registry is a shared resource and good citizenship is cheap.
The headline takeaway across all five dips: the npm ecosystem's real story isn't in its superstars or its horror stories. It's in the enormous quiet middle — mostly single-maintainer, mostly MIT-licensed, either thriving or gone. Sample it yourself and see if your snapshot agrees with mine.