f
parseIdleTimeout(value: string | undefined): ParsedIdleTimeout
Parses the QUNITX_DAEMON_IDLE_TIMEOUT env value. Accepts:
I
ParsedIdleTimeout
Result of parseIdleTimeout: the resolved idle window plus an optional human-readable warning the caller should surface to the user.
-
ms: number
Milliseconds.
Infinitywhen the user opts out of auto-shutdown via"false". -
warning: string | null
Human-readable explanation, set when the env value was malformed. The caller is expected to print this on the spawning CLI's stderr so the user sees it — the daemon process detaches with
stdio: 'ignore', so a warning emitted from inside the daemon would be invisible.
v
DEFAULT_IDLE_TIMEOUT_MS: number
Default daemon idle window: 30 minutes after the last run finishes. Long enough for typical edit/run/edit bursts, short enough that a forgotten daemon reclaims resources without manual intervention.
Usage
import * as mod from "lib/commands/daemon/parse-idle-timeout.ts";