---
title: "@vltpkg/package-info: Reference — vlt docs"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/api-reference/package-info/reference"
image: "https://docs.vlt.io/og/client/api-reference/package-info/reference"
lang: "en"
---

# Reference

## Classes

### PackageInfoClient

Defined in: package-info/src/index.ts:346

#### Constructors

##### new PackageInfoClient()

```ts
new PackageInfoClient(options): PackageInfoClient
```

Defined in: package-info/src/index.ts:595

###### Parameters

| Parameter | Type                                                                                                                      |
| --------- | ------------------------------------------------------------------------------------------------------------------------- |
| `options` | [`PackageInfoClientOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientoptions) |

###### Returns

[`PackageInfoClient`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclient)

#### Properties

| Property      | Type                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `monorepo?`   | [`Monorepo`](https://docs.vlt.io/client/api-reference/workspaces/reference.md#monorepo)                                   |
| `options`     | [`PackageInfoClientOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientoptions) |
| `packageJson` | [`PackageJson`](https://docs.vlt.io/client/api-reference/package-json/reference.md#packagejson)                           |

#### Accessors

##### resolvedManifestCount

###### Get Signature

```ts
get resolvedManifestCount(): number
```

Defined in: package-info/src/index.ts:1693

How many manifests resolve batches have delivered. For tests.

###### Returns

`number`

#### Methods

##### \_manifestCachePath()

```ts
_manifestCachePath(spec, options): undefined | string
```

Defined in: package-info/src/index.ts:1204

Conditionally return the path to the manifest cache file. The logic to determine if caching should be skipped aligns with `pickManifest` and is used to avoid caching manifest results that can be variable.

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                            |
| `options` | [`PackageInfoClientRequestOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientrequestoptions) |

###### Returns

`undefined` | `string`

##### capabilities()

```ts
capabilities(registry): Promise<Capabilities>
```

Defined in: package-info/src/index.ts:489

The vlt extensions `registry` serves, from its `GET /-/vlt/capabilities` document. A registry that does not answer one reads as an empty document, so a missing key means unsupported.

###### Parameters

| Parameter  | Type     |
| ---------- | -------- |
| `registry` | `string` |

###### Returns

`Promise`<[`Capabilities`](https://docs.vlt.io/client/api-reference/package-info/reference.md#capabilities-1)>

##### closeTarPool()

```ts
closeTarPool(): Promise<void>
```

Defined in: package-info/src/index.ts:535

Terminate the tar pool's placement worker threads, if any were started. Reify calls this once placement is done; it is a no-op when the pool was never created or ran inline.

###### Returns

`Promise`<`void`>

##### drain()

```ts
drain(): Promise<void>
```

Defined in: package-info/src/index.ts:458

Wind the client down: abort open resolve streams, settle background work (manifest cache writes, capabilities, hedges), drain the registry client (in-flight requests, cache writes). Await before removing the cache dir or exiting.

###### Returns

`Promise`<`void`>

##### extract()

```ts
extract(
   spec, 
   target, 
options): Promise<ExtractResolution>
```

Defined in: package-info/src/index.ts:618

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                |
| `target`  | `string`                                                                                                                                |
| `options` | [`PackageInfoClientExtractOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientextractoptions) |

###### Returns

`Promise`<[`ExtractResolution`](https://docs.vlt.io/client/api-reference/package-info/reference.md#extractresolution)>

##### getRegistryClient()

```ts
getRegistryClient(): Promise<RegistryClient>
```

Defined in: package-info/src/index.ts:474

###### Returns

`Promise`<[`RegistryClient`](https://docs.vlt.io/client/api-reference/registry-client/module_index.md#registryclient)>

##### getTarPool()

```ts
getTarPool(): Promise<Pool>
```

Defined in: package-info/src/index.ts:519

###### Returns

`Promise`<[`Pool`](https://docs.vlt.io/client/api-reference/tar/pool.md#pool)>

##### manifest()

```ts
manifest(spec, options): Promise<
  | Manifest
| Override<Manifest, NormalizedFields>>
```

Defined in: package-info/src/index.ts:1697

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                |
| `options` | [`PackageInfoClientRequestOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientrequestoptions) |

###### Returns

`Promise`< | [`Manifest`](https://docs.vlt.io/client/api-reference/types/reference.md#manifest) | [`Override`](https://docs.vlt.io/client/api-reference/types/reference.md#overridet-r)<[`Manifest`](https://docs.vlt.io/client/api-reference/types/reference.md#manifest), [`NormalizedFields`](https://docs.vlt.io/client/api-reference/types/reference.md#normalizedfields)>>

##### packument()

```ts
packument(spec, options): Promise<Packument>
```

Defined in: package-info/src/index.ts:1940

The packument for `spec`, with every version the registry has. Callers that only pick a manifest out of it go through `#packument` instead, which can ask for the prerelease-free one.

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                |
| `options` | [`PackageInfoClientRequestOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientrequestoptions) |

###### Returns

`Promise`<[`Packument`](https://docs.vlt.io/client/api-reference/types/reference.md#packument)>

##### prefetchResolve()

```ts
prefetchResolve(registry, request): () => void
```

Defined in: package-info/src/index.ts:1482

Start a server-side resolve for `request` against `registry` and return without waiting. `manifest()` answers from what has arrived, and blocks on the request only when it needs a key that has not.

A no-op unless the registry says it serves the endpoint. Anything it does not deliver is left to `manifest()`.

Returns the function that releases the request. A build calls it once it has placed its last node; when the last build reading a request has released it, the stream is ended, so an install never waits on a stream nothing will read. The records it delivered stay answerable.

###### Parameters

| Parameter  | Type                                                                                                  |
| ---------- | ----------------------------------------------------------------------------------------------------- |
| `registry` | `string`                                                                                              |
| `request`  | [`ResolveRequest`](https://docs.vlt.io/client/api-reference/package-info/reference.md#resolverequest) |

###### Returns

`Function`

###### Returns

`void`

##### resolve()

```ts
resolve(spec, options): Promise<Resolution>
```

Defined in: package-info/src/index.ts:2123

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                |
| `options` | [`PackageInfoClientRequestOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientrequestoptions) |

###### Returns

`Promise`<[`Resolution`](https://docs.vlt.io/client/api-reference/package-info/reference.md#resolution)>

##### tarball()

```ts
tarball(spec, options): Promise<Buffer<ArrayBufferLike>>
```

Defined in: package-info/src/index.ts:1278

###### Parameters

| Parameter | Type                                                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `spec`    | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                |
| `options` | [`PackageInfoClientExtractOptions`](https://docs.vlt.io/client/api-reference/package-info/reference.md#packageinfoclientextractoptions) |

###### Returns

`Promise`<`Buffer`<`ArrayBufferLike`>>

##### warmTarPool()

```ts
warmTarPool(nodes): Promise<void>
```

Defined in: package-info/src/index.ts:552

Start the tar pool's unpack workers for an install about to place `nodes`, so they boot while the first packages are fetched instead of on the critical path of the first unpack. Only the nodes the global store does not already hold count: a store hit is linked on the main thread, so a warm install of all hits starts no worker. Best effort and never rejects: if the pool cannot start, unpacking just runs inline, and a real failure resurfaces at the first extract.

###### Parameters

| Parameter | Type                                                   |
| --------- | ------------------------------------------------------ |
| `nodes`   | `Iterable`<{ `integrity`: `` `sha512-${string}` ``; }> |

###### Returns

`Promise`<`void`>

## Type Aliases

### Capabilities

```ts
type Capabilities = object;
```

Defined in: package-info/src/capabilities.ts:8

What `GET /-/vlt/capabilities` answers: the vlt extensions a registry serves. Every field is optional — a registry that has never heard of the document, or that is down when it is asked, reads as an empty one.

#### Type declaration

| Name             | Type        | Description                                                         |
| ---------------- | ----------- | ------------------------------------------------------------------- |
| `manifests`?     | `string`    | contract version of `/-/vlt/manifests`, the batch manifest endpoint |
| `mimeTypes`?     | `string`\[] | packument media types the registry serves, most preferred first     |
| `resolve`?       | `string`    | contract version of `/-/vlt/resolve`, server-side range resolution  |
| `stable-filter`? | `string`    | contract version of the `?stable` packument filter                  |

---

### ExtractResolution

```ts
type ExtractResolution = Resolution & object;
```

Defined in: package-info/src/index.ts:141

[PackageInfoClient.extract](https://docs.vlt.io/client/api-reference/package-info/reference.md#extract) result. A global store link also carries what its index knows, so reify need not read it from disk.

#### Type declaration

| Name          | Type      | Description                                        |
| ------------- | --------- | -------------------------------------------------- |
| `bindingGyp`? | `boolean` | true if the package has a root binding.gyp         |
| `manifest`?   | `string`  | the package.json as JSON text, if the index has it |

---

### PackageInfoClientExtractOptions

```ts
type PackageInfoClientExtractOptions = PackageInfoClientRequestOptions & object;
```

Defined in: package-info/src/index.ts:229

#### Type declaration

| Name            | Type                                                                                   | Description                                                                                                                                                                                                                    |
| --------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `fromLockfile`? | `boolean`                                                                              | When true, indicates that integrity + resolved came from a lockfile (i.e. they were already verified on first install). Skips re-hashing a refetched body of an already verified url. Other network bodies are always checked. |
| `integrity`?    | [`Integrity`](https://docs.vlt.io/client/api-reference/types/reference.md#integrity-2) | -                                                                                                                                                                                                                              |
| `names`?        | `string`\[]                                                                            | What dependents call the package (aliases included), for error advice that names it, eg `vlt update <name>`. Default: the spec's name.                                                                                         |
| `resolved`?     | `string`                                                                               | -                                                                                                                                                                                                                              |

---

### PackageInfoClientOptions

```ts
type PackageInfoClientOptions = RegistryClientOptions & SpecOptions & object;
```

Defined in: package-info/src/index.ts:148

#### Type declaration

| Name               | Type                                                                                            | Description                                                                                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `brotli-tarballs`? | `boolean`                                                                                       | Resolve to the registry's Brotli (`.tar.br`) tarball when it advertises one in `dist.alternates`. Defaults to true; set false to always resolve to the gzip `.tgz`. |
| `monorepo`?        | [`Monorepo`](https://docs.vlt.io/client/api-reference/workspaces/reference.md#monorepo)         | -                                                                                                                                                                   |
| `packageJson`?     | [`PackageJson`](https://docs.vlt.io/client/api-reference/package-json/reference.md#packagejson) | PackageJson object                                                                                                                                                  |
| `projectRoot`?     | `string`                                                                                        | root of the project. Defaults to process.cwd()                                                                                                                      |
| `store-linker`?    | [`StoreLinker`](https://docs.vlt.io/client/api-reference/tar/link-tree.md#storelinker)          | How registry packages are placed: `unpack` (default) unpacks the tarball, anything else goes through the global store first.                                        |
| `workspace`?       | `string`\[]                                                                                     | workspace paths to load, irrelevant if Monorepo provided                                                                                                            |
| `workspace-group`? | `string`\[]                                                                                     | workspace groups to load, irrelevant if Monorepo provided                                                                                                           |

---

### PackageInfoClientRequestOptions

```ts
type PackageInfoClientRequestOptions = PickManifestOptions & RegistryClientRequestOptions & object;
```

Defined in: package-info/src/index.ts:177

#### Type declaration

| Name                    | Type      | Description                                                                                                                                                                                                                           |
| ----------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `backgroundRevalidate`? | `boolean` | A moving selector whose packument is still within max-age is served from it and revalidated after exit, not before use. Pinned specs are unaffected.                                                                                  |
| `from`?                 | `string`  | dir to resolve `file://` specifiers against. Defaults to projectRoot.                                                                                                                                                                 |
| `full`?                 | `boolean` | Fetch the full packument (readme, maintainers, `dist.integrity`) rather than the abbreviated one. Bypasses the disk cache, which is keyed by URL alone, so the two representations never mix.                                         |
| `gitHostTimeout`?       | `number`  | Milliseconds a git dep's host gets to answer (connect to its archive host, `git ls-remote` its remote) before the manifest is given up on; once per host per run. Unset: as long as the OS waits, minutes for one that drops packets. |

---

### Resolution

```ts
type Resolution = object;
```

Defined in: package-info/src/index.ts:125

#### Type declaration

| Name              | Type                                                                                                                                   | Description                                                                                                                 |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `digestRequired`? | `boolean`                                                                                                                              | The manifest came from a vlt packument, which carries no `dist.integrity`: the tarball response must carry a `Repr-Digest`. |
| `integrity`?      | [`Integrity`](https://docs.vlt.io/client/api-reference/types/reference.md#integrity-2)                                                 | -                                                                                                                           |
| `resolved`        | `string`                                                                                                                               | -                                                                                                                           |
| `signatures`?     | `Exclude`<[`Manifest`](https://docs.vlt.io/client/api-reference/types/reference.md#manifest)\[`"dist"`], `undefined`>\[`"signatures"`] | -                                                                                                                           |
| `spec`            | [`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)                                                           | -                                                                                                                           |

---

### ResolveRequest

```ts
type ResolveRequest = object;
```

Defined in: package-info/src/resolve-batch.ts:21

The request body `/-/vlt/resolve` takes.

#### Type declaration

| Name             | Type        |
| ---------------- | ----------- |
| `closure`?       | `boolean`   |
| `have`?          | `string`\[] |
| `platform`?      | `object`    |
| `platform.cpu`?  | `string`    |
| `platform.libc`? | `string`    |
| `platform.node`? | `string`    |
| `platform.os`?   | `string`    |
| `roots`          | `object`\[] |
| `stop`?          | `object`    |
| `stop.names`?    | `string`\[] |
| `stop.scopes`?   | `string`\[] |
| `tag`?           | `string`    |

## Variables

### delimiter

```ts
const delimiter: "~" = '~';
```

Defined in: package-info/src/index.ts:91

---

### PACKUMENT_ACCEPT

```ts
const PACKUMENT_ACCEPT: "application/vnd.vlt.packument-v2+json; q=1.0, application/vnd.vlt.packument-v1+json; q=0.9, application/json; q=0.8, */*; q=0.1";
```

Defined in: package-info/src/index.ts:123

Accept header for packument requests. Prefers vlt's abbreviated packument, v2 over v1, and falls back to the full one on registries that know neither. See `PackageInfoClient.#fetchPackument`.

The trailing wildcard range carries an explicit `q=0.1` so that it stays below `application/json`. A media range with no `q` defaults to `q=1.0` (RFC 9110 12.5.1), which on a registry that negotiates strictly by quality would let an unrelated representation — npm's corgi among them — outrank the full packument and drop `license`. The wildcard is kept only so a registry that rejects what it cannot satisfy exactly still has something to match.

---

### VLT_PACKUMENT_MIME

```ts
const VLT_PACKUMENT_MIME: "application/vnd.vlt.packument-v1+json" = 'application/vnd.vlt.packument-v1+json';
```

Defined in: package-info/src/index.ts:99

vlt's abbreviated packument: corgi plus the fields the graph relies on (`license`, `time`, `hasInstallScript`), minus `dist.integrity` (the tarball response carries a `Repr-Digest` instead) and with `dist.tarball` relative to the registry base.

---

### VLT_PACKUMENT_V2_MIME

```ts
const VLT_PACKUMENT_V2_MIME: "application/vnd.vlt.packument-v2+json" = 'application/vnd.vlt.packument-v2+json';
```

Defined in: package-info/src/index.ts:107

[VLT_PACKUMENT_MIME](https://docs.vlt.io/client/api-reference/package-info/reference.md#vlt_packument_mime) with each `dist.tarball` reduced to the tarball's basename (`foo-1.0.0.tgz`), which resolves against the package's `{registry}{name}/-/` directory.

## Functions

### getCapabilities()

```ts
function getCapabilities(client, registry): Promise<Capabilities>
```

Defined in: package-info/src/capabilities.ts:64

The vlt extensions `registry` serves. Anything short of a capability document — a registry that 404s it, a request that fails, a body that does not parse — answers an empty one, so a caller that reads a missing key as unsupported treats those registries as plain npm registries.

#### Parameters

| Parameter  | Type                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- |
| `client`   | [`RegistryClient`](https://docs.vlt.io/client/api-reference/registry-client/module_index.md#registryclient) |
| `registry` | `string`                                                                                                    |

#### Returns

`Promise`<[`Capabilities`](https://docs.vlt.io/client/api-reference/package-info/reference.md#capabilities-1)>

---

### peekCapabilities()

```ts
function peekCapabilities(client, registry): undefined | Capabilities
```

Defined in: package-info/src/capabilities.ts:47

What `registry` answered, if it has answered already, and `undefined` while the question is still open. Asking starts the request when nothing has asked yet, so a caller can peek now and get an answer on a later call without ever waiting for one.

#### Parameters

| Parameter  | Type                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- |
| `client`   | [`RegistryClient`](https://docs.vlt.io/client/api-reference/registry-client/module_index.md#registryclient) |
| `registry` | `string`                                                                                                    |

#### Returns

`undefined` | [`Capabilities`](https://docs.vlt.io/client/api-reference/package-info/reference.md#capabilities-1)

---

### resetCapabilities()

```ts
function resetCapabilities(): void
```

Defined in: package-info/src/capabilities.ts:36

Forget every registry that has been asked. Exposed for tests.

#### Returns

`void`
