Skip to content

@loontail/minecraft-kit v0.8.14 / detectSystem

Function: detectSystem()

ts
function detectSystem(input): RuntimeSystem

Resolve the current host system identifiers.

Most callers do not need to invoke this directly: the MinecraftKit constructor defaults to detectSystem() when no system option is supplied, and kit.targets.system exposes the cached result. Use this helper when you want to override one of the host values (e.g. force a different arch for a cross-platform runtime install) before constructing the kit.

Parameters

ParameterType
inputDetectSystemInput

Returns

RuntimeSystem

Throws

MinecraftKitError with code RUNTIME_UNSUPPORTED_PLATFORM when the platform/arch combination is not understood.

Example

ts
import { detectSystem } from "@loontail/minecraft-kit";

const system = detectSystem();
console.log(system.os, system.arch); // → e.g. "windows" "x64"

Source

src/core/system.ts:44

MIT License