Skip to content

Add package dependents/dependees list to package detail view #1987

@KlementMultiverse

Description

@KlementMultiverse

Problem

When browsing a package on npmx.dev, there's no way to see which other packages depend on it. This is critical information for:

  • Package maintainers assessing impact of breaking changes
  • Users evaluating how widely adopted a package is
  • Contributors deciding whether to submit PRs to a package

npmjs.com shows this under "Dependents" (e.g., searching depends:react shows 50k+ packages). npmx.dev has no equivalent feature.

Why it matters

A package with 10k dependents is a critical ecosystem dependency; breaking changes need careful review. A package with 3 dependents is lower risk. This distinction affects decision-making but is invisible in npmx.dev today.

Current behavior

The package detail page (src/routes/package/+page.svelte) displays README, versions, dependencies, downloads, and vulnerabilities. There is no section showing reverse dependencies.

Proposed behavior

Add a "Dependents" section below the dependencies list:

  • Show count of packages that depend on this package
  • Display top 10-20 dependents by download volume as a scrollable list
  • Link each dependent to its npmx.dev package page
  • Include a "View all dependents" link to a filtered search results page
  • Cache the count (updates weekly, similar to download stats) since computing this on-demand would be expensive

Example

When viewing lodash, show:

Dependents (156,234 packages)

1. react - 50.2M weekly downloads
2. @babel/core - 28.1M weekly downloads
3. webpack - 22.3M weekly downloads
...
[View all 156,234 dependents]

Implementation notes

  • npm registry API provides a dependents endpoint (similar to how downloads are fetched)
  • The UI should follow existing patterns in src/components/PackageCard.svelte for displaying package lists
  • Consider lazy-loading the dependents list to avoid slowing page load
  • The count should appear prominently in the package header (next to "Downloads") for quick scanning

Related

Related to #1984 (which addresses vulnerability surfacing) — this feature helps contextualize the risk level of any vulnerabilities found.


Contributed by Klement Gunndu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions