Skip to content

@tauri-apps/plugin-os

Provides operating system-related utility methods and properties.

function arch(): Arch;

Defined in: plugins/os/guest-js/index.ts:162

Returns 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();

Arch

The operating system architecture.

2.0.0


function eol(): string;

Defined in: plugins/os/guest-js/index.ts:78

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

  • \n on POSIX
  • \r\n on Windows
import { eol } from '@tauri-apps/plugin-os';
const eolChar = eol();

string

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

2.0.0


function exeExtension(): string;

Defined in: plugins/os/guest-js/index.ts:177

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

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

string

The file extension used for executable binaries on this platform.

2.0.0


function family(): Family;

Defined in: plugins/os/guest-js/index.ts:131

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

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

Family

The operating system family.

2.0.0


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

Defined in: plugins/os/guest-js/index.ts:210

Returns the host name of the operating system.

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

Promise<string | null>

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

2.0.0


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

Defined in: plugins/os/guest-js/index.ts:195

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

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

Promise<string | null>

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

2.0.0


function platform(): Platform;

Defined in: plugins/os/guest-js/index.ts:96

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'

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

Platform

The platform name.

2.0.0


function type(): OsType;

Defined in: plugins/os/guest-js/index.ts:146

Returns 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();

OsType

The operating system type.

2.0.0


function version(): string;

Defined in: plugins/os/guest-js/index.ts:111

Returns the current operating system version.

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

string

The operating system version.

2.0.0

type Arch =
| "x86"
| "x86_64"
| "arm"
| "aarch64"
| "mips"
| "mips64"
| "powerpc"
| "powerpc64"
| "riscv64"
| "s390x"
| "sparc64";

Defined in: plugins/os/guest-js/index.ts:51

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


type Family = "unix" | "windows";

Defined in: plugins/os/guest-js/index.ts:118

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


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

Defined in: plugins/os/guest-js/index.ts:46

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


type Platform =
| "linux"
| "macos"
| "ios"
| "freebsd"
| "dragonfly"
| "netbsd"
| "openbsd"
| "solaris"
| "android"
| "windows";

Defined in: plugins/os/guest-js/index.ts:31

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


© 2026 Tauri Contributors. CC-BY / MIT