Skip to content

@vltpkg/pick-manifest

Type Aliases

ManiCheck<T>

type ManiCheck<T> = object

Defined in: index.ts:36

Type Parameters

T extends Packumentish

Type declaration

deprecated
deprecated: boolean
mani
mani: PickManifestish<T>
platform
platform: boolean
prerelease
prerelease: boolean
version
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

T extends Packumentish


PickManifestOptions

type PickManifestOptions = object

Defined in: index.ts:21

Type declaration

arch?
optional arch: string;
before?
optional before: Date | number | string;
libc?
optional libc: string;
node-version?
optional node-version: string;
os?
optional os: string;
tag?
optional 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 | string

Defined in: index.ts:174

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 | string

Defined 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 | string

Defined in: index.ts:123

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:259

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

T extends Packumentish

Parameters

packument

T

wanted

string | Range | Spec

opts

PickManifestOptions = {}

Returns

undefined | PickManifestish<T>


platformCheck()

function platformCheck(
mani,
nodeVersion,
wantOs?,
wantArch?,
wantLibc?,
): boolean

Defined in: index.ts:204

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

mani

Manifestish

nodeVersion

string | Version

wantOs?

string

wantArch?

string

wantLibc?

string

Returns

boolean


resetLibcCache()

function resetLibcCache(): void

Defined in: index.ts:163

Reset the cached libc detection result. For testing only.

Returns

void