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
  • Type Aliases
  • LinkFromStoreOptions
  • StoreLinker
  • StoreLinkResult
  • Functions
  • linkFromStore()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/tar
  6. /
  7. link-tree

link-tree

Type Aliases

LinkFromStoreOptions

TypeScript
type LinkFromStoreOptions = object;

Defined in: tar/src/link-tree.ts:47

Type declaration

NameTypeDescription
clone?booleanclone the entry directory copy-on-write (clonefile(2): macOS on APFS) instead of placing files one by one. A failed clone is a store miss, so the caller unpacks: on APFS, hardlinking file by file is slower than that. Where a clone cannot work at all (no clones on this filesystem, another volume), every later call is a miss without trying. A clone shares no file with the store, so it needs no copy on top, for copy or for install scripts.
copy?booleancopy every file instead of hardlinking

StoreLinker

TypeScript
type StoreLinker = "auto" | "hardlink" | "clone" | "copy" | "unpack";

Defined in: tar/src/link-tree.ts:36

How reify places packages: auto and hardlink link from the global store, clone clones from it (macOS), copy copies from it, unpack skips it.


StoreLinkResult

TypeScript
type StoreLinkResult = 
  | {
  how: "link" | "clone" | "copy";
  index: StoreIndex;
 }
  | false;

Defined in: tar/src/link-tree.ts:44

How a store entry was placed (clone: the whole directory cloned copy-on-write; copy: every file copied, for copy or a downgrade) and its index, or false on a miss.

Functions

linkFromStore()

TypeScript
function linkFromStore(
   storeEntry, 
   target, 
   __namedParameters): StoreLinkResult

Defined in: tar/src/link-tree.ts:242

Materialize a global store entry at target from its sidecar index: hardlink each file into a sibling temp dir (package.json last), or with clone clone the whole entry there, then rename it into place. Files that cannot be linked are copied; if package.json is copied after another file was linked, the whole package is copied, so a private package.json means nothing is shared. Returns how, with the index, or false, leaving target untouched, on a store miss (no valid index, entry not a directory, symlinked target parent, a failed clone), a name clash on a case-insensitive target, or a damaged entry, which is removed.

Parameters

ParameterType
storeEntrystring
targetstring
__namedParametersLinkFromStoreOptions

Returns

StoreLinkResult


PreviousclonefileNextindex

On this page

  • Type Aliases
  • LinkFromStoreOptions
  • StoreLinker
  • StoreLinkResult
  • Functions
  • linkFromStore()

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