Skip to content

OS Information

Read information about the operating system using the OS Information plugin.

Install the OS Information plugin to get started.

Use your project’s package manager to add the dependency:

npm run tauri add os

With this plugin you can query multiple information from current operational system. See all available functions in the JavaScript API or Rust API references.

platform 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 currentPlatform = await platform();
// Prints "windows" to the console

© 2024 Tauri Contributors. CC-BY / MIT