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
  • Functions
  • markStoreEntryCopied()
  • removeStoreEntry()
  • storeCopiedPath()
  • storeEntryCopied()
  • storeEntryLinked()
  • storeEntryNames()
  • storeEntryTime()
  • verifyStoreEntry()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/tar
  6. /
  7. store-entry

store-entry

Functions

markStoreEntryCopied()

TypeScript
function markStoreEntryCopied(storeEntry): void

Defined in: store-entry.ts:52

Mark a global store entry as copied from. Called on copies only: one exclusive create per entry, a failed open after that.

Parameters

ParameterType
storeEntrystring

Returns

void


removeStoreEntry()

TypeScript
function removeStoreEntry(storeEntry): void

Defined in: store-entry.ts:64

Remove a global store entry. Dir first: a sidecar without its dir is a plain miss. Projects linked from it keep their files.

Parameters

ParameterType
storeEntrystring

Returns

void


storeCopiedPath()

TypeScript
function storeCopiedPath(storeEntry): string

Defined in: store-entry.ts:45

Marker next to a global store entry: some install copied from it, so its files' nlink cannot show use. See markStoreEntryCopied.

Parameters

ParameterType
storeEntrystring

Returns

string


storeEntryCopied()

TypeScript
function storeEntryCopied(storeEntry, index): boolean

Defined in: store-entry.ts:85

True if the global store entry has a valid sidecar and dir, and was copied from (marker) or has install scripts (always copied). index: the sidecar, if already read.

Parameters

ParameterType
storeEntrystring
indexundefined | StoreIndex

Returns

boolean


storeEntryLinked()

TypeScript
function storeEntryLinked(storeEntry, index): boolean

Defined in: store-entry.ts:100

True if a file of the global store entry has another hardlink (nlink > 1), i.e. some node_modules uses it. Without a valid sidecar nothing can link from it, so false. index: the sidecar, if already read.

Parameters

ParameterType
storeEntrystring
indexundefined | StoreIndex

Returns

boolean


storeEntryNames()

TypeScript
function storeEntryNames(root): string[]

Defined in: store-entry.ts:26

Integrity hex names of the global store entries under root, each with an entry dir, a sidecar index or a copied marker. Sorted.

Parameters

ParameterType
rootstring

Returns

string[]


storeEntryTime()

TypeScript
function storeEntryTime(storeEntry): number

Defined in: store-entry.ts:74

When a global store entry was written, in ms: its sidecar's mtime, else its dir's, else 0.

Parameters

ParameterType
storeEntrystring

Returns

number


verifyStoreEntry()

TypeScript
function verifyStoreEntry(storeEntry, tarData): undefined | string

Defined in: store-entry.ts:126

Check a global store entry against the tarball it was exploded from: sidecar index, file list, every file's bytes and exec bit (not on Windows). Returns why it does not match, or undefined if it does.

Parameters

ParameterType
storeEntrystring
tarDataBuffer

Returns

undefined | string


PreviousReferenceNextstore-index

On this page

  • Functions
  • markStoreEntryCopied()
  • removeStoreEntry()
  • storeCopiedPath()
  • storeEntryCopied()
  • storeEntryLinked()
  • storeEntryNames()
  • storeEntryTime()
  • verifyStoreEntry()

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