
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
query-registry
Advanced tools
Query the npm registry for packuments, manifests, packages and download counts
query-registry
is an API wrapper for the npm registry API.
Using npm
:
npm add query-registry
Using yarn
:
yarn add query-registry
Using pnpm
:
pnpm add query-registry
Using bun
:
bun add query-registry
Get the metadata about the npm registry itself, if available:
import { getRegistryMetadata } from "query-registry";
const metadata = await getRegistryMetadata();
Get the public signing keys for the npm registry:
import { getRegistrySigningKeys } from "query-registry";
const { keys } = await getRegistrySigningKeys();
Get the abbreviated packument containing only the necessary data to install the react
package:
import { getAbbreviatedPackument } from "query-registry";
const abbrPackument = await getAbbreviatedPackument("react");
Get the full packument containing all the data available about the react
package:
import { getPackument } from "query-registry";
const packument = await getPackument("react");
Get the manifest containing the original package.json
data plus additional registry metadata for the latest
version of the react
package:
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react");
Get the manifest for react@18.2.0
(semver version):
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react", "18.2.0");
Get the manifest for react@next
(distribution tag):
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react", "next");
Search packages related to react
(e.g., react
, react-dom
, ...):
import { searchPackages } from "query-registry";
const results = await searchPackages({ text: "react" });
Get the total number of downloads for package react
for the last month:
import { getPackageDownloads } from "query-registry";
const { downloads } = await getPackageDownloads("react", "last-month");
There are also these other download counts functions available: getBulkDailyPackageDownloads
, getBulkPackageDownloads
, getDailyPackageDownloads
, getDailyRegistryDownloads
and getPackageVersionsDownloads
.
Clear the internal cache.
import { cache } from "query-registry";
cache.clear();
See the quick-lru package for the cache API.
MIT
Copyright (c) 2025 Edoardo Scibona
See LICENSE file.
[4.0.1] - 2025-03-31
type
module format field (See https://github.com/velut/query-registry/issues/415) (Thanks @officialrajdeepsingh)FAQs
Query the npm registry for packuments, manifests, packages and download counts
The npm package query-registry receives a total of 27,669 weekly downloads. As such, query-registry popularity was classified as popular.
We found that query-registry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.