System Module

Dynamic Variables (vars)

Structured key-value store for global parameters, build configuration, and software metadata.

The vars module provides a centralized memory store for application-wide settings. It supports both built-in system properties (like version and root path) and user-defined dynamic variables with full IntelliSense support.

Built-in Global Properties

These formal properties are initialized by the framework and reflect the core identity of the executing instance.

__version__
Software version
__author__
Project creator
__name__
Project identifier
__root__
Absolute project root
__port__
Execution port
__alias__
Short name/shortcut
__description__
Application summary
__app_urls__
Endpoint dictionary

Variable Management

.get(key, defaultValue?)

Securely retrieves a value. It automatically checks explicit global properties before searching the dynamic map.

typescript
const theme = __sys__.vars.get("theme", "standard-dark");
const root = __sys__.vars.get("__root__");

.set(key, value)

Instantiates or overwrites a dynamic variable in application memory.

typescript
__sys__.vars.set("max_retries", 5);

.update(data)

Iteratively merges a complex data block into the store.

typescript
__sys__.vars.update({
    cache_ttl: 3600,
    allow_guests: false
});

Extraction & Utilities

.all() / .toJSON()

Generates a consolidated representation of the entire current store.

.clone()

Creates a robust, unlinked memory copy to prevent collateral mutation.

Persistency Note
The vars store is volatile and resides in memory. For persistent configuration across restarts, use the fs module to write to a JSON file or the __env__ module for environment-level settings.
Start Here

Go back to the introduction or jump to the installation guide.