vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Type Aliases
  • ManiCheck<T>
  • Manifestish
  • Packumentish
  • PickManifestish<T>
  • PickManifestOptions
  • Variables
  • LDD_PATH
  • Functions
  • detectLibc()
  • getFamilyFromFilesystem()
  • getFamilyFromReport()
  • pickManifest()
  • platformCheck()
  • resetLibcCache()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/pick-manifest
  6. /
  7. Reference

Reference

Type Aliases

ManiCheck<T>

TypeScript
type ManiCheck<T> = object;

Defined in: index.ts:36

Type Parameters

Type Parameter
T extends Packumentish

Type declaration

NameType
deprecatedboolean
maniPickManifestish<T>
platformboolean
prereleaseboolean
versionVersion

Manifestish

TypeScript
type Manifestish = 
  | Pick<Manifest, "engines" | "os" | "cpu" | "libc">
| Pick<RevDocEntry, "engines" | "os" | "cpu" | "libc">;

Defined in: index.ts:30


Packumentish

TypeScript
type Packumentish = 
  | Packument
  | RevDoc;

Defined in: index.ts:33


PickManifestish<T>

TypeScript
type PickManifestish<T> = T extends RevDoc ? RevDocEntry : Manifest;

Defined in: index.ts:34

Type Parameters

Type Parameter
T extends Packumentish

PickManifestOptions

TypeScript
type PickManifestOptions = object;

Defined in: index.ts:21

Type declaration

NameType
arch?string
before?Date | number | string
libc?string
node-version?string
os?string
tag?string

Variables

LDD_PATH

TypeScript
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()

TypeScript
function detectLibc(): undefined | string

Defined 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()

TypeScript
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()

TypeScript
function getFamilyFromReport(): null | string

Defined in: index.ts:121

Detect libc family by using process.report.getReport(). Returns 'glibc', 'musl', or null if detection fails.

Returns

null | string


pickManifest()

TypeScript
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

ParameterType
packumentT
wanted| string | Range | Spec
optsPickManifestOptions

Returns

undefined | PickManifestish<T>


platformCheck()

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

Defined 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

ParameterType
maniManifestish
nodeVersionstring | Version
wantOs?string
wantArch?string
wantLibc?string

Returns

boolean


resetLibcCache()

TypeScript
function resetLibcCache(): void

Defined in: index.ts:161

Reset the cached libc detection result. For testing only.

Returns

void


Previous@vltpkg/pick-manifestNext@vltpkg/promise-spawn

On this page

  • Type Aliases
  • ManiCheck<T>
  • Manifestish
  • Packumentish
  • PickManifestish<T>
  • PickManifestOptions
  • Variables
  • LDD_PATH
  • Functions
  • detectLibc()
  • getFamilyFromFilesystem()
  • getFamilyFromReport()
  • pickManifest()
  • platformCheck()
  • resetLibcCache()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now