Skip to content

OS

OS object is used to get OS details.

  • Module: platform/os
  • Source: /platform/os.ts
  • Status: stable
  • Group: platform

Basic Usage

import { OS } from "sdk/platform";

if (OS.isWindows()) {
    // Windows logic here
}

if (OS.isUnix()) {
    // Unix logic here
}

const osName = OS.OS_NAME;
console.log("OS is: " + osName);

Constants


Constant Description Returns
name The name of the current OS which corresponds to the os.name system property string

Functions


Function Description Returns
isWindows() Check whether current OS is Windows boolean
isUnix() Check whether current OS is Unix boolean