Skip to content

arch ​

arch returns the target CPU architecture as a native OsArch enum. It reflects the target this binary was compiled for, not a runtime guess.

Signaturearch(): OsArch
tyrus
import { arch } from "tyrus:os";
import { OsArch } from "tyrus:os";

const currentArch: OsArch = arch();

if (currentArch === OsArch.Aarch64) {
    print("running on an ARM64 target");
}

OsArch Members ​

MemberMeaning
X86_6464-bit x86
Aarch6464-bit ARM
X8632-bit x86
Arm32-bit ARM
OtherAny other target