interface ExitTarget

The parts of process the guard touches, so a test can drive its exit without exiting.

Properties

optional
exitCode: number | string | null | undefined

The code the process will exit with; assigning it is how the guard has its say.

Methods

on(
event: "exit",
listener: () => void
): unknown

Registers the exit listener — the last moment anything can still be said or decided.

Usage

import { type ExitTarget } from "lib/utils/exit-guard.ts";