link-tree
Type Aliases
LinkFromStoreOptions
type LinkFromStoreOptions = object;Defined in: tar/src/link-tree.ts:47
Type declaration
| Name | Type | Description |
|---|---|---|
clone? | boolean | clone 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? | boolean | copy every file instead of hardlinking |
StoreLinker
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
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()
function linkFromStore(
storeEntry,
target,
__namedParameters): StoreLinkResultDefined 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
| Parameter | Type |
|---|---|
storeEntry | string |
target | string |
__namedParameters | LinkFromStoreOptions |