link-tree
Type Aliases
LinkFromStoreOptions
type LinkFromStoreOptions = object;Defined in: link-tree.ts:42
Type declaration
| Name | Type | Description |
|---|---|---|
copy? | boolean | copy every file instead of hardlinking. Implied when the index says the package runs install scripts, which must not write into the store. |
StoreLinker
type StoreLinker = "auto" | "hardlink" | "copy" | "unpack";Defined in: link-tree.ts:33
How reify places packages: auto and hardlink link from the global
store, copy copies from it, unpack skips it.
StoreLinkResult
type StoreLinkResult =
| {
how: "link" | "copy";
index: StoreIndex;
}
| false;Defined in: link-tree.ts:39
How a store entry was placed (copy: every file copied, for install
scripts, copy or a downgrade) and its index, or false on a miss.
Functions
linkFromStore()
function linkFromStore(
storeEntry,
target,
__namedParameters): StoreLinkResultDefined in: link-tree.ts:158
Materialize a global store entry at target from its sidecar index:
hardlink each file into a sibling temp dir (package.json last), then
rename it into place. Files that cannot be linked are copied, as is
every file of a package with install scripts. 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 name
clash on a case-insensitive target, or a damaged entry, which is
removed.
Parameters
| Parameter | Type |
|---|---|
storeEntry | string |
target | string |
__namedParameters | LinkFromStoreOptions |