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:
| Field | Type | Description |
|---|---|---|
cpus | number | Number of logical CPU cores (snapshot at load) |
memory | number | Total JVM memory in bytes (snapshot at load) |
arch | string | System architecture (e.g. windows-x64 / linux-x64 / linux-arm64) |
minecraftVersion | string | Minecraft version (e.g. 1.21.4) |
yeow | Runtime information (e.g. { platform: 'paper', version: '0.8.0' }) | |
pluginDir | string | Plugin 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__envbefore executing plugin code (see the "Global Variables" section of the platform specification).