Files
prosperon/docs/api/modules/os.md
John Alanbrook 83b798e365 Add Hugo website and rewrite docs to match current engine
New Hugo site in website/ with prosperon.dev theme (blue/gold/castle
aesthetic), docs sidebar navigation, and content pages. Rewrote all
doc files to align with the actual codebase: compositor+film2d
rendering, use() modules (no global prosperon object), Pit language,
script+JSON entity model. Added entities.md, front matter to all
70+ API docs, and updated API index for current module architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:09:55 -06:00

2.7 KiB

title, type
title type
os docs

os

make_transform() function

Create a new transform object that can be used for 2D/3D positioning, scaling, and rotation.

clean_transforms() function

Force an update on all transforms to remove dangling references or perform house-keeping.

platform() function

Return a string with the underlying platform name, like 'Windows', 'Linux', or 'macOS'.

arch() function

Return the CPU architecture string for this system (e.g. 'x64', 'arm64').

totalmem() function

Return the total system RAM in bytes.

freemem() function

Return the amount of free system RAM in bytes, if known.

hostname() function

Return the system's hostname, or an empty string if not available.

version() function

Return the OS or kernel version string, if the platform provides it.

kill() function

Send a signal (e.g., 'SIGINT', 'SIGTERM', etc.) to the current process.

exit() function

Exit the application with the specified exit code.

now() function

Return current time (in seconds as a float) with high resolution.

openurl() function

Open the provided URL in the default web browser, if possible.

make_timer() function

Create a new timer object that will call a specified function after a certain delay.

update_timers() function

Advance all timers by the provided time delta (in seconds).

sleep() function

Block execution for the specified number of seconds.

battery_pct() function

Return the battery level (percentage) or negative if unknown.

battery_voltage() function

Return the current battery voltage in volts, if available.

battery_seconds() function

Return the estimated remaining battery time in seconds, or negative if unknown.

power_state() function

Return a string describing power status: 'on battery', 'charging', 'charged', etc.

on() function

Register a global callback for certain engine-wide or system-level events.

rt_info() function

Return internal QuickJS runtime info, such as object counts.

rusage() function

Return resource usage stats for this process, if the platform supports it.

mallinfo() function

Return detailed memory allocation info (arena size, free blocks, etc.) on some platforms.

env() function

Fetch the value of a given environment variable, or undefined if it doesn't exist.

system() function

Execute a shell command using the system() call. Returns the command's exit code.