vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • link-tree
    • index
    • pool
    • Reference
    • store-entry
    • store-index
    • unpack
  • Type Aliases
  • StoreIndex
  • StoreIndexFile
  • StoreIndexManifest
  • Functions
  • readStoreIndex()
  • storeIndexManifest()
  • storeIndexPath()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/tar
  6. /
  7. store-index

store-index

Type Aliases

StoreIndex

TypeScript
type StoreIndex = object;

Defined in: store-index.ts:18

Sidecar index of a global store entry, stored at storeIndexPath. Lets a reader materialize the entry without walking it, and know before touching it whether the package runs install scripts.

Type declaration

NameTypeDescription
bins?Record<string, string>normalized package.json bin
dirsstring[]every directory, shortest first
filesStoreIndexFile[]relative, /-separated, sorted by path
manifest?stringpackage.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-
scriptsbooleanhas an install/preinstall/postinstall script or a root binding.gyp
v1-
version?string-

StoreIndexFile

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

Defined in: store-index.ts:10

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


StoreIndexManifest

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

Defined in: store-index.ts:39

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

Functions

readStoreIndex()

TypeScript
function readStoreIndex(storeEntry): undefined | StoreIndex

Defined in: 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

ParameterType
storeEntrystring

Returns

undefined | StoreIndex


storeIndexManifest()

TypeScript
function storeIndexManifest(packageJson, bindingGyp): StoreIndexManifest

Defined in: 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

ParameterType
packageJsonBuffer
bindingGypboolean

Returns

StoreIndexManifest


storeIndexPath()

TypeScript
function storeIndexPath(storeEntry): string

Defined in: store-index.ts:45

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

Parameters

ParameterType
storeEntrystring

Returns

string


Previousstore-entryNextunpack

On this page

  • Type Aliases
  • StoreIndex
  • StoreIndexFile
  • StoreIndexManifest
  • Functions
  • readStoreIndex()
  • storeIndexManifest()
  • storeIndexPath()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now