Roves
roves-api

process

exit() — close every window Roves opened, quitting the app.

Edit on GitHub

The Roves equivalent of @tauri-apps/plugin-process's exit().

import { exit } from "@drincs/roves-api/process";

await exit();

Why not window.close()?

Browsers (and Roves) only grant scripted window.close() on windows the page itself opened via window.open() — not on the top-level window a native shell created for you, which is the normal case for a game embedded in Roves. exit() instead asks the native side directly (roves:exit), which closes every open window through Roves' own window-management API — not the DOM API.

In Roves' usual single-window setup, closing the one window is quitting the app: once no windows remain open, the engine's own event loop exits on its own.