Manages npm authentication tokens.
Handles reading, validating, and masking auth tokens used for private registry access.
Summary
Functions
Returns the auth header value for the given token.
Checks if a valid auth token is configured.
Masks a token for safe display.
Reads token from an .npmrc file content.
Reads the auth token from environment or .npmrc.
Validates token format.
Functions
Returns the auth header value for the given token.
@spec configured?() :: boolean()
Checks if a valid auth token is configured.
Masks a token for safe display.
Shows only the first and last 4 characters.
Reads token from an .npmrc file content.
@spec read() :: String.t() | nil
Reads the auth token from environment or .npmrc.
Validates token format.
npm tokens are typically UUIDs or base64-encoded strings.