Skip to content

@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#L51

A string describing the specific operating system architecture in use, as returned by arch.


type Family = "unix" | "windows";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L118

A string describing the operating system family, as returned by family.


type OsType = "linux" | "windows" | "macos" | "ios" | "android";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L46

A coarse-grained operating system category, as returned by type.


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#L31

A string describing the specific operating system in use, as returned by platform.

function arch(): Arch;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L162

Returns the current operating system architecture. Possible values are 'x86', 'x86_64', 'arm', 'aarch64', 'mips', 'mips64', 'powerpc', 'powerpc64', 'riscv64', 's390x', 'sparc64'.

Arch

The operating system architecture.

import { arch } from '@tauri-apps/plugin-os';
const archName = arch();

2.0.0


function eol(): string;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L78

Returns the operating system-specific end-of-line marker.

  • \n on POSIX
  • \r\n on Windows

string

The end-of-line marker for the current platform.

import { eol } from '@tauri-apps/plugin-os';
const eolChar = eol();

2.0.0


function exeExtension(): string;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L177

Returns the file extension, if any, used for executable binaries on this platform. Possible values are 'exe' and '' (empty string).

string

The file extension used for executable binaries on this platform.

import { exeExtension } from '@tauri-apps/plugin-os';
const exeExt = exeExtension();

2.0.0


function family(): Family;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L131

Returns the current operating system family. Possible values are 'unix', 'windows'.

Family

The operating system family.

import { family } from '@tauri-apps/plugin-os';
const family = family();

2.0.0


function hostname(): Promise<string | null>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L210

Returns the host name of the operating system.

Promise<string | null>

A promise resolving to the host name of the operating system.

import { hostname } from '@tauri-apps/plugin-os';
const hostname = await hostname();

2.0.0


function locale(): Promise<string | null>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L195

Returns a String with a BCP-47 language tag inside. If the locale couldn’t be obtained, null is returned instead.

Promise<string | null>

A promise resolving to the BCP-47 language tag, or null if it could not be obtained.

import { locale } from '@tauri-apps/plugin-os';
const locale = await locale();
if (locale) {
// use the locale string here
}

2.0.0


function platform(): Platform;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L96

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'

Platform

The platform name.

import { platform } from '@tauri-apps/plugin-os';
const platformName = platform();

2.0.0


function type(): OsType;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L146

Returns the current operating system type. Returns 'linux' on Linux, 'macos' on macOS, 'windows' on Windows, 'ios' on iOS and 'android' on Android.

OsType

The operating system type.

import { type } from '@tauri-apps/plugin-os';
const osType = type();

2.0.0


function version(): string;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/os/guest-js/index.ts#L111

Returns the current operating system version.

string

The operating system version.

import { version } from '@tauri-apps/plugin-os';
const osVersion = version();

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT