HTTP client for the npm registry.
Fetches abbreviated packuments (version list + deps + dist info) using the npm registry API.
Summary
Functions
URL-encode a package name (handles scoped packages).
Fetch the abbreviated packument for a package.
Get the configured registry URL.
Types
@type packument() :: %{ name: String.t(), versions: %{required(String.t()) => version_info()} }
@type version_info() :: %{ dependencies: %{required(String.t()) => String.t()}, optional_dependencies: %{required(String.t()) => String.t()}, peer_dependencies: %{required(String.t()) => String.t()}, peer_dependencies_meta: %{required(String.t()) => map()}, bin: %{optional(String.t()) => String.t()}, engines: %{required(String.t()) => String.t()}, os: [String.t()], cpu: [String.t()], has_install_script: boolean(), deprecated: String.t() | nil, dist: %{ tarball: String.t(), integrity: String.t(), file_count: integer() | nil, unpacked_size: integer() | nil } }
Functions
URL-encode a package name (handles scoped packages).
Fetch the abbreviated packument for a package.
@spec registry_url() :: String.t()
Get the configured registry URL.