Optional configuration for registry URL, downloads API URL, and auth token
Fetches the per-day download breakdown for a package over a given period.
GET /downloads/range/{period}/{package} (via api.npmjs.org)
Convenience method — equivalent to npm.package(name).downloadRange(period).
Named period or date range
The package name
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Download range data with a per-day array
Fetches the total download count for a package over a given period.
GET /downloads/point/{period}/{package} (via api.npmjs.org)
Convenience method — equivalent to npm.package(name).downloads(period).
Named period or date range
The package name
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Download point data including total count and date range
Returns a MaintainerResource for a given npm username, providing access to all packages they maintain.
GET /-/v1/search?text=maintainer:{username}
The npm username (e.g. 'sindresorhus', 'pilmee')
A maintainer resource with a packages() method
Subscribes to a client event.
Returns a PackageResource for a given package name, providing access to package metadata, versions, dist-tags, and download statistics.
The returned resource can be awaited directly to fetch the full packument, or chained to access nested resources.
The package name (e.g. 'react', '@types/node')
A chainable package resource
Searches for packages on the npm registry.
GET /-/v1/search
Search parameters (required: text)
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Search results including packages, scores, and total count
Main entry point for the npm Registry API client.
Example