Skip to content

index | @vltpkg/registry-client

References

CacheEntry

Re-exports CacheEntry

Classes

RegistryClient

Constructors

new RegistryClient()
new RegistryClient(__namedParameters): RegistryClient
Parameters

__namedParameters: RegistryClientOptions

Returns

RegistryClient

Defined in

index.ts:97

Properties

agent
agent: Agent
Defined in

index.ts:94

cache
cache: Cache
Defined in

index.ts:95

Methods

request()
request(url, options): Promise<CacheEntry>
Parameters

url: string | URL

options: RegistryClientRequestOptions = {}

Returns

Promise<CacheEntry>

Defined in

index.ts:109

Type Aliases

RegistryClientOptions

type RegistryClientOptions: object;

Type declaration

cache?
optional cache: string;

Path on disk where the cache should be stored

Default

$HOME/.config/vlt/cache

Defined in

index.ts:16


RegistryClientRequestOptions

type RegistryClientRequestOptions: Omit<Dispatcher.DispatchOptions, "method" | "path"> & object;

Type declaration

integrity?
optional integrity: Integrity;

Provide an SRI string to verify integrity of the item being fetched.

This is only relevant when it must make a request to the registry. Once in the local disk cache, items are assumed to be trustworthy.

maxRedirections?
optional maxRedirections: number;

Follow up to 10 redirections by default. Set this to 0 to just return the 3xx response. If the max redirections are expired, and we still get a redirection response, then fail the request. Redirection cycles are always treated as an error.

method?
optional method: Dispatcher.DispatchOptions["method"];

Method is optional, defaults to ‘GET’

path?
optional path: string;

path should not be set when using the RegistryClient. It will be overwritten with the path on the URL being requested. This only here for compliance with the DispatchOptions base type.

Deprecated

Defined in

index.ts:24

Variables

userAgent

const userAgent: string

Defined in

index.ts:73