Prints the daemon-mode tip to stderr and creates a sentinel file so the tip is shown at most once per machine — users who already know about the daemon shouldn't be nagged. All filesystem I/O is best-effort: a sentinel-write failure just means the hint shows again on the next eligible run.
Pure check: returns true iff the run context permits the hint. Covers env-var opt-outs, watch / daemon modes (own browser lifecycle), CI (auto-bypassed), the fast-run threshold, and TTY presence. No filesystem access.
Run context consumed by the daemon-hint eligibility check.
-
daemonMode: boolean
True if this is the daemon process itself running the work — never hint.
-
durationMs: number
Total wall-clock the run took, in ms. Used against the fast-run threshold.
-
env: NodeJS.ProcessEnv
Environment to inspect for opt-outs. Defaults to
process.env. -
isTTY: boolean
Override TTY detection (defaults to
process.stderr.isTTY). Used in tests. -
watch: boolean
True if the run is
--watchmode (manages its own browser lifecycle — bypass).
Side-effect injection points for maybePrint — testing seams.
-
sentinelPath: string
Sentinel-file path (defaults to
~/.cache/qunitx/hint-shown). -
write: (text: string) => void
Writer function (defaults to
process.stderr.write).
Usage
import * as mod from "lib/commands/daemon/hint.ts";