Skip to content

Environment Info (Env) ​

Retrieves runtime environment information — a purely local read, no round trip.

js
import { getEnv } from 'yeow-api';

const env = getEnv();   // synchronous return (local read, no $send involved)
console.log(env.arch, env.minecraftVersion, env.yeow.version);

Returns EnvInfo:

FieldTypeDescription
cpusnumberNumber of logical CPU cores (snapshot at load)
memorynumberTotal JVM memory in bytes (snapshot at load)
archstringSystem architecture (e.g. windows-x64 / linux-x64 / linux-arm64)
minecraftVersionstringMinecraft version (e.g. 1.21.4)
yeowRuntime information (e.g. { platform: 'paper', version: '0.8.0' })
pluginDirstringPlugin data directory path (e.g. plugins/my-plugin on Paper/Folia; the main plugin directory in a Worker)

The env info is a static snapshot injected by the runtime at load time; reading it uses no channel. Use Date.now() / performance.now() when you need time. Implementations must inject __env before executing plugin code (see the "Global Variables" section of the platform specification).