API: os
Source:
platform/os.ts
Utility class for retrieving operating system information and checking OS types. It leverages the platform's access to Java's SystemUtils for system properties.
Usage
javascript
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);Classes
OS
@class OS
@description Provides static methods and constants related to the operating system
the underlying Java platform is running on.
Methods
isWindows
isWindows ():booleanChecks if the operating system is a variant of Windows.
@returns {boolean} True if the OS is Windows, false otherwise.
isUnix
isUnix ():booleanChecks if the operating system is a variant of Unix (including Linux, macOS, and BSD).
@returns {boolean} True if the OS is Unix-like, false otherwise.