greenServeFEgreenServeFE

Documentation home / Native Module API

Native Module API

Environment Variable API

Read, test, set and unset process environment variables.

Purpose

Read, test, set and unset process environment variables.

Exports registered by the module initializer

ExportRole
getget helper
hashas helper
setset helper
unsetunset helper

Usage

import gs_env;
gs_env.set("APP_MODE", "test");
print(gs_env.has("APP_MODE"));
print(gs_env.get("APP_MODE"));
gs_env.unset("APP_MODE");
Environment mutation affects the running process and may be inherited by child processes. Avoid logging secrets.

Related: Module catalog · Native ABI · Language guide.