Code and repositories / Repository settings
See npm downloads of your packages
You publish packages to npm from your repository, and you want to know which ones grow. The npm tab shows the downloads of each package in the repository, with its latest version and its last publish.
8 min read
Anyone who can read the repository sees the tab. The tab shows when the default branch has a package.json at its root, and at least one package of the default branch that is not "private": true is on npm. A repository whose packages are all private, or not published, has no npm tab. After your first publish, the tab can take up to an hour to show. You can still open /@<owner>/<repo>/npm by its address.
1. Open the npm tab
Open the repository, then click the npm tab (/@<owner>/<repo>/npm).
In a terminal, in your clone:
src repo npm

The tab opens at once. Until the numbers arrive, it shows gray placeholders. If the numbers could not load, click Retry.
2. Pick a range
At the top right of the page, click a range:
- 7 days, 30 days (the default) or 90 days.
- 6 months or 1 year.
- Custom: pick the first day in From and the last day in To.
Each range has its own URL, for example ?range=90d or ?from=2026-01-01&to=2026-03-31. Source has the downloads of about the last 18 months, so From and To stay inside those days.
In Interval, choose Daily, Weekly or Monthly. Auto shows daily points for up to 30 days and weekly points for longer ranges. Weeks run Monday to Sunday in UTC. The chart leaves out weeks and months with missing days, including partial periods at the edges of the range.
Pick Latest day, Latest week or Latest month to jump to the newest complete period. Use the arrows to step through earlier periods. Click a package pill to show or hide its series.
Above the chart, the page shows the total of the range and the change from the range before it.
Note
1 year shows no change, because Source does not have the downloads of the year before.
3. Read the Downloads chart
The Downloads chart shows one line for each package, each in its own color. At first, it shows the 10 packages with the most weekly downloads.
- To hide or show the line of a package, click its pill above the chart.
- If the repository has more than 10 packages, click Show all to show all lines. Click Top 10 to go back.
- To see the total of all packages, turn on Stacked. The lines become areas on top of each other, and the top edge is the total.
The total above the chart counts all packages, also the packages that you hide.
4. Read the tiles and the table
The tiles at the top:
- Weekly downloads: the downloads of all packages in the last 7 days, and the change from the 7 days before.
- Packages: the number of packages that Source found in the repository.
- Verified: the number of packages that this repository publishes. See Verified packages.
The table shows one row for each package, the most weekly downloads first:
| Column | What it shows |
|---|---|
| Package | The name, with a link to the page of the package on npm. Under the name, the path of its package.json. |
| Version | The latest version on npm. |
| Last publish | The last change of the package on npm. This is usually its last publish. |
| Weekly downloads | The downloads of the last 7 days. |
| Change | The change from the 7 days before, in percent. New means that the 7 days before had no downloads. |
The last column draws the downloads of each full week of the last year as a small line.
The table shows the first 50 packages. When there are more, click Show all under the table to list every package.
On a phone, the table has no Version, Last publish or trend column, and the change shows under the weekly downloads.
5. Open the chart of one package
Click a row, or the arrow at the left of the name. The chart of that package opens under the row, for the same range. Click the row again to close the chart.
Above the chart, Chart has two views:
- Selected range (the default): the downloads in the range of the page, at the interval of the page.
- Weekly, like npm: the downloads of each full week of the last year. This is the same line as the trend column of the table, and as the chart on npmjs.com. The total above the chart then counts the last year, the same as the range 1 year.
The view applies only to the chart of this package. The Downloads chart does not change, and the URL does not keep the view.
Some rows have no chart:
- Not on npm: npm does not know a package with this name.
- Could not load: npm did not answer for this package. The rest of the page still loads.
Done
You see:
- Which packages have the most downloads this week.
- Which packages grow, and which drop.
- The downloads of each package, week by week, for up to the last 18 months.
To post a chart on X or LinkedIn, read Share a download chart as an image. To see the packages of all the public repositories of an organization on one page, read See npm downloads of your organization.
Verified packages
A package.json can claim any name. So a package in the table is not always the package with that name on npm. The Verified tag shows that this repository really publishes the package.
A package gets the Verified tag when both are true:
- The
repositoryfield of the package on npm points to a GitHub repository. - This repository is public, is not a fork, and its admin verified it as that GitHub repository.
When more than one repository is verified as the same GitHub repository, only the oldest one gets the tag.
A package with no tag can still come from this repository. The tag only shows that Source can prove the link. The packages of a private repository never get the tag.
To get the tag for your packages, read Verify your GitHub repository. Source keeps the answers of npm for some hours, so a new tag can take up to a day to show.
Which packages show
- Each
package.jsonon the tip of the default branch that has anameand is not"private": true. - Source skips
node_modules,vendor,dist,buildand each folder whose name starts with a dot. - Source reads at most 500
package.jsonfiles. When a repository has more, the page says "Only the first 500 package files are shown." - When no package can show, the page says "No packages to show".
The download numbers are at most 2 minutes old. Source reads the version, the last publish and the Verified tag again when they are more than an hour old. It does that after it shows the page, so the page does not wait for npm. The first view after an hour can still show the old values, and they are never more than a day old. After a push to the default branch, Source reads the package list again. Under the table, the page shows when Source read them, for example "Updated 12 minutes ago."
Read the downloads from a script or an agent
An agent or a script reads the same numbers with src, REST or MCP. The token needs read access to the repository.
With src:
src repo npm acme/app
Each line shows the name, verified, the latest version, the weekly downloads and the change. A package that npm does not know shows not on npm. A package that npm did not answer for shows could not load.
Add --json packages to get each package with its downloads per day:
src repo npm acme/app --json packages
With REST:
curl -H "Authorization: Bearer $TOKEN" "https://source.tanstack.com/api/v1/repos/acme/app/npm"
The answer has these fields:
packages: one entry for each package, the most weekly downloads first. Each entry hasname,path,verified,status(ok,not_foundorfailed),version,publishedAt,weekly,previousWeeklyanddays.days(in each package): the downloads of each day of the last 540 full days (up to yesterday, UTC), oldest first.head: the commit that Source read thepackage.jsonfiles from. It isnullfor an empty repository.truncated:truewhen the repository has more than 500package.jsonfiles.fetchedAt: when Source assembled the stats. Daily downloads come from the TanStack.com npm stats cache.
With MCP, call the tool get_repo_npm_stats with owner and repo. It gives the same answer as REST. See Connect over MCP.
The charts and the share images are on the web only.