Reference
Type Aliases
ManiCheck<T>
type ManiCheck<T> = object;Defined in: index.ts:36
Type Parameters
| Type Parameter |
|---|
T extends Packumentish |
Type declaration
| Name | Type |
|---|---|
deprecated | boolean |
mani | PickManifestish<T> |
platform | boolean |
prerelease | boolean |
version | Version |
Manifestish
type Manifestish =
| Pick<Manifest, "engines" | "os" | "cpu" | "libc">
| Pick<RevDocEntry, "engines" | "os" | "cpu" | "libc">;Defined in: index.ts:30
Packumentish
type Packumentish =
| Packument
| RevDoc;Defined in: index.ts:33
PickManifestish<T>
type PickManifestish<T> = T extends RevDoc ? RevDocEntry : Manifest;Defined in: index.ts:34
Type Parameters
| Type Parameter |
|---|
T extends Packumentish |
PickManifestOptions
type PickManifestOptions = object;Defined in: index.ts:21
Type declaration
| Name | Type |
|---|---|
arch? | string |
before? | Date | number | string |
libc? | string |
node-version? | string |
os? | string |
tag? | string |
Variables
LDD_PATH
const LDD_PATH: "/usr/bin/ldd" = '/usr/bin/ldd';Defined in: index.ts:90
Path to the ldd binary used for filesystem-based libc detection.
Functions
detectLibc()
function detectLibc(): undefined | stringDefined in: index.ts:172
Detect the libc family (glibc or musl) on Linux systems. First tries filesystem-based detection (/usr/bin/ldd), then falls back to process.report. Returns undefined on non-Linux platforms or if detection fails.
Returns
undefined | string
getFamilyFromFilesystem()
function getFamilyFromFilesystem(): undefined | null | stringDefined in: index.ts:97
Detect libc family by reading the /usr/bin/ldd file. Returns 'glibc', 'musl', null (detection ran but unknown) or undefined (file not readable).
Returns
undefined | null | string
getFamilyFromReport()
function getFamilyFromReport(): null | stringDefined in: index.ts:121
Detect libc family by using process.report.getReport(). Returns 'glibc', 'musl', or null if detection fails.
Returns
null | string
pickManifest()
function pickManifest<T>(
packument,
wanted,
opts): undefined | PickManifestish<T>Defined in: index.ts:257
Choose the most appropriate manifest from a packument.
If before is set in the options, then the packument MUST
be a full non-minified Packument object. Otherwise, a minified packument
is fine.
Type Parameters
| Type Parameter |
|---|
T extends Packumentish |
Parameters
| Parameter | Type |
|---|---|
packument | T |
wanted | | string | Range | Spec |
opts | PickManifestOptions |
Returns
undefined | PickManifestish<T>
platformCheck()
function platformCheck(
mani,
nodeVersion,
wantOs?,
wantArch?,
wantLibc?): booleanDefined in: index.ts:202
Call with a manifest and the node version and process platform/arch/libc to check whether a version is suitable for the current platform.
Parameters
| Parameter | Type |
|---|---|
mani | Manifestish |
nodeVersion | string | Version |
wantOs? | string |
wantArch? | string |
wantLibc? | string |
Returns
boolean
resetLibcCache()
function resetLibcCache(): voidDefined in: index.ts:161
Reset the cached libc detection result. For testing only.
Returns
void