@tauri-apps/plugin-os
Provides operating system-related utility methods and properties.
Type Aliases
Section titled “Type Aliases”type Arch = | "x86" | "x86_64" | "arm" | "aarch64" | "mips" | "mips64" | "powerpc" | "powerpc64" | "riscv64" | "s390x" | "sparc64";Source: undefined
Family
Section titled “Family”type Family = "unix" | "windows";Source: undefined
OsType
Section titled “OsType”type OsType = "linux" | "windows" | "macos" | "ios" | "android";Source: undefined
Platform
Section titled “Platform”type Platform = | "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows";Source: undefined
Functions
Section titled “Functions”arch()
Section titled “arch()”function arch(): Arch;Source: undefined
Returns the current operating system architecture.
Possible values are 'x86', 'x86_64', 'arm', 'aarch64', 'mips', 'mips64', 'powerpc', 'powerpc64', 'riscv64', 's390x', 'sparc64'.
Returns
Section titled “Returns”Example
Section titled “Example”import { arch } from '@tauri-apps/plugin-os';const archName = arch();2.0.0
function eol(): string;Source: undefined
Returns the operating system-specific end-of-line marker.
\non POSIX\r\non Windows
Returns
Section titled “Returns”string
2.0.0
exeExtension()
Section titled “exeExtension()”function exeExtension(): string;Source: undefined
Returns the file extension, if any, used for executable binaries on this platform. Possible values are 'exe' and '' (empty string).
Returns
Section titled “Returns”string
Example
Section titled “Example”import { exeExtension } from '@tauri-apps/plugin-os';const exeExt = exeExtension();2.0.0
family()
Section titled “family()”function family(): Family;Source: undefined
Returns the current operating system family. Possible values are 'unix', 'windows'.
Returns
Section titled “Returns”Example
Section titled “Example”import { family } from '@tauri-apps/plugin-os';const family = family();2.0.0
hostname()
Section titled “hostname()”function hostname(): Promise<string | null>;Source: undefined
Returns the host name of the operating system.
Returns
Section titled “Returns”Promise<string | null>
Example
Section titled “Example”import { hostname } from '@tauri-apps/plugin-os';const hostname = await hostname();locale()
Section titled “locale()”function locale(): Promise<string | null>;Source: undefined
Returns a String with a BCP-47 language tag inside. If the locale couldn’t be obtained, null is returned instead.
Returns
Section titled “Returns”Promise<string | null>
Example
Section titled “Example”import { locale } from '@tauri-apps/plugin-os';const locale = await locale();if (locale) { // use the locale string here}2.0.0
platform()
Section titled “platform()”function platform(): Platform;Source: undefined
Returns 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'
Returns
Section titled “Returns”Example
Section titled “Example”import { platform } from '@tauri-apps/plugin-os';const platformName = platform();2.0.0
type()
Section titled “type()”function type(): OsType;Source: undefined
Returns the current operating system type. Returns 'linux' on Linux, 'macos' on macOS, 'windows' on Windows, 'ios' on iOS and 'android' on Android.
Returns
Section titled “Returns”Example
Section titled “Example”import { type } from '@tauri-apps/plugin-os';const osType = type();2.0.0
version()
Section titled “version()”function version(): string;Source: undefined
Returns the current operating system version.
Returns
Section titled “Returns”string
Example
Section titled “Example”import { version } from '@tauri-apps/plugin-os';const osVersion = version();2.0.0
© 2026 Tauri Contributors. CC-BY / MIT