Fetches the bundle size history for this package across all published versions.
GET /api/package-history?package={name}
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
A map of version strings to their size and gzip values
Fetches similar/alternative packages to this one.
GET /api/similar-packages?package={name}
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
A list of alternative packages with their bundle sizes
Fetches the bundle size for this package.
GET /api/size?package={name}@{version}
Optionalversion: stringSpecific version to fetch (default: latest)
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Bundle size data including minified and gzip sizes
Allows the resource to be awaited directly, resolving with the bundle size for the latest version. Delegates to PackageResource.size.
Optionalonfulfilled: null | (value: BundleSize) => TResult1 | PromiseLike<TResult1>Optionalonrejected: null | (reason: unknown) => TResult2 | PromiseLike<TResult2>
Represents a package resource on Bundlephobia, providing access to bundle size, version history, and similar packages.
Implements
PromiseLike<BundleSize>so it can be awaited directly to fetch the bundle size for the latest version.Example