Skip to main content

PlatformDetector.getPlatformInfo() method

Retrieves current platform and architecture information.

Signature

getPlatformInfo(options?: PlatformInfoOptions): PlatformInfo;

Parameters

Parameter

Type

Description

options

PlatformInfoOptions

(Optional) Configuration options controlling platform information retrieval.

Returns

PlatformInfo

Platform and architecture information.

Remarks

This method returns a PlatformInfo object containing the operating system platform and CPU architecture. When the doForce32bit option is enabled, 64-bit architectures are coerced to their 32-bit equivalents.

Architecture coercion rules (when doForce32bit is true):

  • x64 → ia32: Coerces 64-bit Intel/AMD to 32-bit.
  • arm64 → arm: Coerces 64-bit ARM to 32-bit.

This coercion is useful for backward compatibility scenarios where only 32-bit binaries are available but can run on 64-bit systems via compatibility layers.

The platform identifier is never modified and always reflects the actual operating system (darwin, linux, win32).


Generated via tsdoc2docusaurus 1.3.2 by API Extractor/Documenter 7.57.2.