Saltar al contenido

@tauri-apps/plugin-os

Proporciona métodos y propiedades de utilidad relacionados con el sistema operativo.

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

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


type Family: "unix" | "windows";

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


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

Fuente: 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";

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

function arch(): Arch

Devuelve la arquitectura actual del sistema operativo. Los valores posibles son 'x86', 'x86_64', 'arm', 'aarch64', 'mips', 'mips64', 'powerpc', 'powerpc64', 'riscv64', 's390x', 'sparc64'.

Arquitectura

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

2.0.0

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


function eol(): string

Devuelve el marcador de fin de línea específico del sistema operativo.

  • \n en POSIX
  • \r\n en Windows

string

2.0.0

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


function exeExtension(): string

Devuelve la extensión de archivo, si existe, utilizada para los binarios ejecutables en esta plataforma. Los valores posibles son 'exe' y '' (cadena vacía).

string

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

2.0.0

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


function family(): Family

Devuelve la familia actual del sistema operativo. Los valores posibles son 'unix', 'windows'.

Familia

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

2.0.0

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


function hostname(): Promise<string | null>

Devuelve el nombre de host del sistema operativo.

Promise<string | null>

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

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


function locale(): Promise<string | null>

Devuelve una cadena (String) con una etiqueta de idioma BCP-47 en su interior. Si no se pudo obtener la configuración regional (locale), se devuelve null en su lugar.

Promise<string | null>

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

2.0.0

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


function platform(): Platform

Devuelve una cadena que describe el sistema operativo específico en uso. El valor se establece en tiempo de compilación. Los valores posibles son 'linux', 'macos', 'ios', 'freebsd', 'dragonfly', 'netbsd', 'openbsd', 'solaris', 'android', 'windows'

Plataforma

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

2.0.0

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


function type(): OsType

Devuelve el tipo actual del sistema operativo. Devuelve 'linux' en Linux, 'macos' en macOS, 'windows' en Windows, 'ios' en iOS y 'android' en Android.

OsType

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

2.0.0

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


function version(): string

Devuelve la versión actual del sistema operativo.

string

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

2.0.0

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


© 2026 Colaboradores de Tauri. CC-BY / MIT