Skip to main content

@rtorcato/js-common / system

system

Functions​

isMacOs()​

isMacOs(): boolean

Defined in: system/index.ts:17

Checks if the current OS is macOS.

The user-agent branch is deprecated — browser detection belongs to @rtorcato/browser-common and will be removed in the next major. In Node this reads process.platform and stays.

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:43

Checks if the current OS is Windows.

The user-agent branch is deprecated — browser detection belongs to @rtorcato/browser-common and will be removed in the next major. In Node this reads process.platform and stays.

Example​

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

Returns​

boolean

True if Windows, false otherwise.


isLinux()​

isLinux(): boolean

Defined in: system/index.ts:67

Checks if the current OS is Linux.

The user-agent branch is deprecated — browser detection belongs to @rtorcato/browser-common and will be removed in the next major. In Node this reads process.platform and stays.

Example​

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

Returns​

boolean

True if Linux, false otherwise.


isIOS()​

isIOS(): boolean

Defined in: system/index.ts:83

Checks if the device is running iOS. Always false in Node.

Returns​

boolean

True if iOS, false otherwise.

Deprecated​

Browser detection belongs to @rtorcato/browser-common; removed in the next major.


isAndroid()​

isAndroid(): boolean

Defined in: system/index.ts:95

Checks if the device is running Android. Always false in Node.

Returns​

boolean

True if Android, false otherwise.

Deprecated​

Browser detection belongs to @rtorcato/browser-common; removed in the next major.


getPlatform()​

getPlatform(): string

Defined in: system/index.ts:110

Returns a string representing the detected platform.

The user-agent branch is deprecated — browser detection belongs to @rtorcato/browser-common and will be removed in the next major. In Node this reads process.platform and stays.

Returns​

string

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


isTouchDevice()​

isTouchDevice(): boolean

Defined in: system/index.ts:125

Checks if the device supports touch events. Always false in Node.

Returns​

boolean

True if touch is supported, false otherwise.

Deprecated​

Browser detection belongs to @rtorcato/browser-common; removed in the next major.