Skip to main content

Module package_registry

Module package_registry 

Source
Expand description

Safe preflight selection for npm-compatible package registries.

The planner never executes a package manager. It runs fresh, anonymous probes before a registry-fetching command starts and returns the one environment override the caller may apply to that single process.

Structs§

RegistryProbe

Enums§

PackageManager
RegistryPlan

Functions§

manager_for_command
Resolve an executable name to a package-manager family. Yarn is only classified when its major version is known; callers must otherwise pass it through unchanged.
plan
Build a one-shot registry plan. Each call performs fresh concurrent probes; the selected URL is the first healthy candidate in configured order.
registry_env
Environment variable injected into the one package-manager process after a successful plan. pnpm intentionally uses its own variable; pnpm 11 does not honor npm_config_registry for this purpose.
should_plan
Return whether this invocation may resolve or fetch npm packages. This is a deliberately explicit allow-list so routine commands never make probes.