store-index
Type Aliases
StoreIndex
type StoreIndex = object;Defined in: store-index.ts:18
Sidecar index of a global store entry, stored at storeIndexPath. Lets a reader materialize the entry without walking it, and know before touching it whether the package runs install scripts.
Type declaration
| Name | Type | Description |
|---|---|---|
bins? | Record<string, string> | normalized package.json bin |
dirs | string[] | every directory, shortest first |
files | StoreIndexFile[] | relative, /-separated, sorted by path |
manifest? | string | package.json as compact JSON text, if a valid manifest, so reify need not read it back from disk. Text, so a reader that does not need it skips the parse. Absent in entries written before it. |
name? | string | - |
scripts | boolean | has an install/preinstall/postinstall script or a root binding.gyp |
v | 1 | - |
version? | string | - |
StoreIndexFile
type StoreIndexFile = [string, number, 0 | 1];Defined in: store-index.ts:10
[path, size, exec] of one file in a global store entry.
StoreIndexManifest
type StoreIndexManifest = Pick<StoreIndex, "scripts" | "bins" | "name" | "version" | "manifest">;Defined in: store-index.ts:39
Index fields read from the tarball's own package.json.
Functions
readStoreIndex()
function readStoreIndex(storeEntry): undefined | StoreIndexDefined in: store-index.ts:86
Read the sidecar index of a global store entry. Missing, unparseable or malformed is a store miss (undefined), never an error.
Parameters
| Parameter | Type |
|---|---|
storeEntry | string |
Returns
undefined | StoreIndex
storeIndexManifest()
function storeIndexManifest(packageJson, bindingGyp): StoreIndexManifestDefined in: store-index.ts:111
Index fields from a tarball's package.json. scripts uses the same
predicate as reify's build check: an install lifecycle script, or a
root binding.gyp (implicit node-gyp rebuild). Throws on anything
but a JSON object, so such tarballs never become store entries.
Parameters
| Parameter | Type |
|---|---|
packageJson | Buffer |
bindingGyp | boolean |
Returns
storeIndexPath()
function storeIndexPath(storeEntry): stringDefined in: store-index.ts:45
The sidecar is a sibling, so it is never linked with the tree.
Parameters
| Parameter | Type |
|---|---|
storeEntry | string |
Returns
string