Skip to content
Tauri

Process

This plugin provides APIs to access the current process. To spawn child processes, see the shell plugin.

Setup

Install the plugin-process to get started.

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

npm run tauri add process

Usage

The process plugin is available in both JavaScript and Rust.

import { exit, relaunch } from '@tauri-apps/plugin-process';
// when using `"withGlobalTauri": true`, you may use
// const { exit, relaunch } = window.__TAURI_PLUGIN_PROCESS__;
// exits the app with the given status code
await exit(0);
// restarts the app
await relaunch();

Default Permission

This permission set configures which process feeatures are by default exposed.

Granted Permissions

This enables to quit via allow-exit and restart via allow-restart the application.

  • allow-exit
  • allow-restart

Permission Table

Identifier Description

process:allow-exit

Enables the exit command without any pre-configured scope.

process:deny-exit

Denies the exit command without any pre-configured scope.

process:allow-restart

Enables the restart command without any pre-configured scope.

process:deny-restart

Denies the restart command without any pre-configured scope.


© 2024 Tauri Contributors. CC-BY / MIT