Skip to main content

@rtorcato/js-common / system

system

Functions

isMacOs()

isMacOs(): boolean

Defined in: system/index.ts:11

Checks if the current OS is macOS.

Example

isMacOs() // true on macOS (via process.platform in Node, userAgent in the browser)

Returns

boolean

True if macOS, false otherwise.


isWindows()

isWindows(): boolean

Defined in: system/index.ts:31

Checks if the current OS is Windows.

Example

isWindows() // true when process.platform === 'win32'

Returns

boolean

True if Windows, false otherwise.


isLinux()

isLinux(): boolean

Defined in: system/index.ts:51

Checks if the current OS is Linux.

Example

isLinux() // true when process.platform === 'linux'

Returns

boolean

True if Linux, false otherwise.


isIOS()

isIOS(): boolean

Defined in: system/index.ts:65

Checks if the device is running iOS.

Returns

boolean

True if iOS, false otherwise.


isAndroid()

isAndroid(): boolean

Defined in: system/index.ts:76

Checks if the device is running Android.

Returns

boolean

True if Android, false otherwise.


getPlatform()

getPlatform(): string

Defined in: system/index.ts:87

Returns a string representing the detected platform.

Returns

string

The platform name (e.g., 'macos', 'windows', 'linux', 'ios', 'android', or 'unknown').


isTouchDevice()

isTouchDevice(): boolean

Defined in: system/index.ts:100

Checks if the device supports touch events.

Returns

boolean

True if touch is supported, false otherwise.