Subscribes to a client event.
Returns a PackageResource for a given package name, providing access to bundle size, version history, and similar packages.
The returned resource can be awaited directly to fetch the bundle size for the latest version, or chained to access specific methods.
The package name (e.g. 'react', '@types/node')
A chainable package resource
Main entry point for the Bundlephobia API client.
Example