Skip to content

system

Vara's library for accessing system data.


fields

Os : "linux" | "macos" | "windows"

The operating system being used.

Arch : "x86_64" | "aarch64"

The architecture of the processor thats currently being used.

Family : "unix" | "windows"

The family of operating system being used.

Cwd : string

The current working directory.

Temp : string

The temp directory.

Home : string

The home directory.

Endian : "big" | "little"

The endianess of the processor being used.

LanguagePreferences : LanguagePreferences

Language preferences set on the user's system.

Distro : string

What operating system distribution the system is using.

Device : string

The name of the device currently being used.

ProcessID : number

The PID of the current process.

DesktopEnvironment : number

The desktop environment the system is using.

Env : {[string] : string}

The environment variables declared by the system and a optional .env file.

Args : {[number] : string}

Command line arguments passed into the program.


functions

ProcessorCount -> number

system.ProcessorCount() : number
The number of logical CPUs available on the system.

PhysicalMemoryUsage -> number

system.PhysicalMemoryUsage() : number
The ammount of physical memory being used up by the process.

VirtualMemoryUsage -> number

system.VirtualMemoryUsage() : number
The ammount of virtual memory being used up by the process.


types

LanguagePreferences

type LanguagePreferences : {
    -- language preferences for time
    Time : {string},
    -- language preferences for currency
    Monetary : {string},
    -- language preferences for collating words
    Collation : {string},
    -- language preferences for messaging
    Message : {string},
    -- language preferences for numbers.
    Numeric : {string},
}