element.version === currentVersion)) { versionNodes.unshift({ version: currentVersion, url: "#" }); } document.querySelector("#project-version").innerHTML = versionNodes.reduce( (acc, element) => { const status = currentVersion === element.version ? "selected disabled" : ""; return ` ${acc} `; }, `
pontil_platform · v1.0.1

pontil/platform

Hex.pm Hex Docs Apache 2.0 JavaScript Compatible Erlang Compatible

Platform detection for Gleam, returning the runtime environment, operating system, and CPU architecture for Erlang and JavaScript targets. Originally a port of the core platform functionality from actions/toolkit (extracted from the preview release of pontil). Runtime detection was adapted from DitherWither/platform.

Usage

gleam add pontil_platform@1
import pontil/platform

pub fn main() {
  echo platform.details()
}

// Outputs one of:
//
// PlatformInfo("macOS", "26.3.1", Erlang, "28", Darwin, Arm64)
// PlatformInfo(
//   name: "macOS",
//   version: "26.3.1",
//   runtime: Node,
//   runtime_version: "24.15.0",
//   os: Darwin,
//   arch: Arm64)
// )
// PlatformInfo(
//   name: "macOS",
//   version: "26.3.1",
//   runtime: Bun,
//   runtime_version: "1.3.10",
//   os: Darwin,
//   arch: Arm64)
// )
// PlatformInfo(
//   name: "macOS",
//   version: "26.3.1",
//   runtime: Deno,
//   runtime_version: "2.7.10",
//   os: Darwin,
//   arch: Arm64)
// )

Semantic Versioning

Pontil platform follows Semantic Versioning 2.0.

Search Document