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

# store-index

## Type Aliases

### StoreIndex

```ts
type StoreIndex = object;
```

Defined in: tar/src/store-index.ts:18

Sidecar index of a global store entry, stored at [storeIndexPath](https://docs.vlt.io/client/api-reference/tar/store-index.md#storeindexpath). Lets a reader materialize the entry without walking it, and know before touching it whether the package runs install scripts.

#### Type declaration

| Name        | Type                                                                                              | Description                                                                                                                                                                                     |
| ----------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bins`?     | `Record`<`string`, `string`>                                                                      | normalized package.json `bin`                                                                                                                                                                   |
| `dirs`      | `string`\[]                                                                                       | every directory, shortest first                                                                                                                                                                 |
| `files`     | [`StoreIndexFile`](https://docs.vlt.io/client/api-reference/tar/store-index.md#storeindexfile)\[] | relative, `/`-separated, sorted by path                                                                                                                                                         |
| `manifest`? | `string`                                                                                          | package.json as compact JSON text, if a valid manifest, so reify need not read it back from disk. Text, so a reader that does not need it skips the parse. Absent in entries written before it. |
| `name`?     | `string`                                                                                          | -                                                                                                                                                                                               |
| `scripts`   | `boolean`                                                                                         | has an install/preinstall/postinstall script or a root binding.gyp                                                                                                                              |
| `v`         | `1`                                                                                               | -                                                                                                                                                                                               |
| `version`?  | `string`                                                                                          | -                                                                                                                                                                                               |

---

### StoreIndexFile

```ts
type StoreIndexFile = [string, number, 0 | 1];
```

Defined in: tar/src/store-index.ts:10

`[path, size, exec]` of one file in a global store entry.

---

### StoreIndexManifest

```ts
type StoreIndexManifest = Pick<StoreIndex, "scripts" | "bins" | "name" | "version" | "manifest">;
```

Defined in: tar/src/store-index.ts:39

Index fields read from the tarball's own package.json.

## Functions

### readStoreIndex()

```ts
function readStoreIndex(storeEntry): undefined | StoreIndex
```

Defined in: tar/src/store-index.ts:86

Read the sidecar index of a global store entry. Missing, unparseable or malformed is a store miss (undefined), never an error.

#### Parameters

| Parameter    | Type     |
| ------------ | -------- |
| `storeEntry` | `string` |

#### Returns

`undefined` | [`StoreIndex`](https://docs.vlt.io/client/api-reference/tar/store-index.md#storeindex)

---

### storeIndexManifest()

```ts
function storeIndexManifest(packageJson, bindingGyp): StoreIndexManifest
```

Defined in: tar/src/store-index.ts:111

Index fields from a tarball's package.json. `scripts` uses the same predicate as reify's build check: an install lifecycle script, or a root binding.gyp (implicit `node-gyp rebuild`). Throws on anything but a JSON object, so such tarballs never become store entries.

#### Parameters

| Parameter     | Type      |
| ------------- | --------- |
| `packageJson` | `Buffer`  |
| `bindingGyp`  | `boolean` |

#### Returns

[`StoreIndexManifest`](https://docs.vlt.io/client/api-reference/tar/store-index.md#storeindexmanifest)

---

### storeIndexPath()

```ts
function storeIndexPath(storeEntry): string
```

Defined in: tar/src/store-index.ts:45

The sidecar is a sibling, so it is never linked with the tree.

#### Parameters

| Parameter    | Type     |
| ------------ | -------- |
| `storeEntry` | `string` |

#### Returns

`string`
