@tauri-apps/plugin-os
Provides operating system-related utility methods and properties.
type Arch:  | "x86"  | "x86_64"  | "arm"  | "aarch64"  | "mips"  | "mips64"  | "powerpc"  | "powerpc64"  | "riscv64"  | "s390x"  | "sparc64";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L42
type Family: "unix" | "windows";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L97
type OsType:  | "linux"  | "windows"  | "macos"  | "ios"  | "android";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L40
type Platform:  | "linux"  | "macos"  | "ios"  | "freebsd"  | "dragonfly"  | "netbsd"  | "openbsd"  | "solaris"  | "android"  | "windows";Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L28
function arch(): ArchReturns the current operating system architecture.
Possible values are 'x86', 'x86_64', 'arm', 'aarch64', 'mips', 'mips64', 'powerpc', 'powerpc64', 'riscv64', 's390x', 'sparc64'.
import { arch } from '@tauri-apps/plugin-os';const archName = arch();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L138
function eol(): stringReturns the operating system-specific end-of-line marker.
- \non POSIX
- \r\non Windows
string
2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L62
function exeExtension(): stringReturns the file extension, if any, used for executable binaries on this platform. Possible values are 'exe' and '' (empty string).
string
import { exeExtension } from '@tauri-apps/plugin-os';const exeExt = exeExtension();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L152
function family(): FamilyReturns the current operating system family. Possible values are 'unix', 'windows'.
import { family } from '@tauri-apps/plugin-os';const family = family();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L109
function hostname(): Promise<string | null>Returns the host name of the operating system.
Promise<string | null>
import { hostname } from '@tauri-apps/plugin-os';const hostname = await hostname();Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L181
function locale(): Promise<string | null>Returns a String with a BCP-47 language tag inside. If the locale couldn’t be obtained, null is returned instead.
Promise<string | null>
import { locale } from '@tauri-apps/plugin-os';const locale = await locale();if (locale) {   // use the locale string here}2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L169
function platform(): PlatformReturns a string describing the specific operating system in use.
The value is set at compile time. Possible values are 'linux', 'macos', 'ios', 'freebsd', 'dragonfly', 'netbsd', 'openbsd', 'solaris', 'android', 'windows'
import { platform } from '@tauri-apps/plugin-os';const platformName = platform();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L79
function type(): OsTypeReturns the current operating system type. Returns 'linux' on Linux, 'macos' on macOS, 'windows' on Windows, 'ios' on iOS and 'android' on Android.
import { type } from '@tauri-apps/plugin-os';const osType = type();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L123
function version(): stringReturns the current operating system version.
string
import { version } from '@tauri-apps/plugin-os';const osVersion = version();2.0.0
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L93
© 2025 Tauri Contributors. CC-BY / MIT