vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • clonefile
    • link-tree
    • index
    • pool
    • Reference
    • store-entry
    • store-index
    • unpack
  • Functions
  • markStoreEntryCopied()
  • removeStoreEntry()
  • storeCopiedPath()
  • storeEntryCopied()
  • storeEntryLastCopied()
  • 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: tar/src/store-entry.ts:56

Mark a global store entry as copied from, now. Called on uses that nlink cannot show (copies, clones, links copied before install scripts): one create per entry, then a touch per use, so prune-store can tell an entry still in use from one long forgotten.

Parameters

ParameterType
storeEntrystring

Returns

void


removeStoreEntry()

TypeScript
function removeStoreEntry(storeEntry): void

Defined in: tar/src/store-entry.ts:74

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: tar/src/store-entry.ts:47

Marker next to a global store entry: some install copied or cloned from it, so its files' nlink cannot show use; its mtime is the last time one did. See markStoreEntryCopied.

Parameters

ParameterType
storeEntrystring

Returns

string


storeEntryCopied()

TypeScript
function storeEntryCopied(storeEntry, index): boolean

Defined in: tar/src/store-entry.ts:103

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

Parameters

ParameterType
storeEntrystring
indexundefined | StoreIndex

Returns

boolean


storeEntryLastCopied()

TypeScript
function storeEntryLastCopied(storeEntry): number

Defined in: tar/src/store-entry.ts:94

When a global store entry was last copied from, in ms: its marker's mtime, else when it was written (storeEntryTime).

Parameters

ParameterType
storeEntrystring

Returns

number


storeEntryLinked()

TypeScript
function storeEntryLinked(storeEntry, index): boolean

Defined in: tar/src/store-entry.ts:118

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: tar/src/store-entry.ts:27

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: tar/src/store-entry.ts:84

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: tar/src/store-entry.ts:144

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()
  • storeEntryLastCopied()
  • 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