npmHttpUtils
Index
Enumerations
AuthType
ALWAYS_AUTH
BEST_EFFORT
CONFIGURATION
NO_AUTH
Type Aliases
GetPackageMetadataOptions
Options
PackageMetadata
Type declaration
dist-tags: Record<string, string>
versions: Record<string, { [ key in typeof CACHED_FIELDS[number] ]: any } & { dist: { tarball: string } }>
Functions
customPackageError
Parameters
error: RequestError
configuration: Configuration
Returns null | string
del
Parameters
path: string
__namedParameters: Options & { attemptedAs?: string }
Returns Promise<Buffer>
get
Parameters
path: string
__namedParameters: Options
Returns Promise<any>
getIdentUrl
Parameters
ident: Ident
Returns string
getPackageMetadata
Parameters
ident: Ident
__namedParameters: GetPackageMetadataOptions
Returns Promise<PackageMetadata>
handleInvalidAuthenticationError
Consumes all 401 Unauthorized errors and reports them as
AUTHENTICATION_INVALID
.It doesn't handle 403 Forbidden, as the npm registry uses it when the user attempts a prohibited action, such as publishing a package with a similar name to an existing package.
Parameters
error: any
__namedParameters: { attemptedAs?: string; configuration: Configuration; headers: undefined | {}; registry: string }
Returns Promise<void>
Caches and returns the package metadata for the given ident.
Note: This function only caches and returns specific fields from the metadata. If you need other fields, use the uncached get or consider whether it would make more sense to extract the fields from the on-disk packages using the linkers or from the fetch results using the fetchers.