# closeout > Runs every exit handler exactly once on every path out of the process, restores the terminal, and holds shutdown to a deadline so it cannot hang. Zero dependencies. Drop-in paths for signal-exit, exit-hook, restore-cursor, cli-cursor and onetime. ## Documentation - [closeout/cli-cursor](https://closeout.interlace.tools/docs/api/cli-cursor): Every export of closeout/cli-cursor, with its signature and doc comment: cliCursor. - [closeout/cursor](https://closeout.interlace.tools/docs/api/cursor): Every export of closeout/cursor, with its signature and doc comment: showCursor, hideCursor, alternateScreen, bracketedPaste, rawMode, HIDE_CURSOR and 5 more, plus 3 types. - [closeout/exit-hook](https://closeout.interlace.tools/docs/api/exit-hook): Every export of closeout/exit-hook, with its signature and doc comment: asyncExitHook, gracefulExit, exitHook, plus 3 types. - [closeout](https://closeout.interlace.tools/docs/api): Every export of closeout, with its signature and doc comment: alternateScreen, assertDeadline, createRegistry, DEADLINE_ERROR_CODE, DeadlineError, DEFAULT_DEADLINE and 17 more, plus 16 types. - [closeout/once](https://closeout.interlace.tools/docs/api/once): Every export of closeout/once, with its signature and doc comment: once. - [closeout/onetime](https://closeout.interlace.tools/docs/api/onetime): Every export of closeout/onetime, with its signature and doc comment: onetime, plus 2 types. - [closeout/plugin](https://closeout.interlace.tools/docs/api/plugin): Every export of closeout/plugin, with its signature and doc comment: validate, register, reset, registered, contributions, attach and 3 more, plus 5 types. - [closeout/restore-cursor](https://closeout.interlace.tools/docs/api/restore-cursor): Every export of closeout/restore-cursor, with its signature and doc comment: restoreCursor. - [closeout/signal-exit](https://closeout.interlace.tools/docs/api/signal-exit): Every export of closeout/signal-exit, with its signature and doc comment: onExit, load, unload, signals. - [closeout/signal-exit/signals](https://closeout.interlace.tools/docs/api/signal-exit/signals): Every export of closeout/signal-exit/signals, with its signature and doc comment: signals. - [Changelog](https://closeout.interlace.tools/docs/changelog): Every release of closeout, newest first, from its CHANGELOG.md — what changed and the pull request it came from. - [Coming from exit-hook](https://closeout.interlace.tools/docs/coming-from/exit-hook): An exit-hook alternative with a drop-in path: import exitHook from closeout/exit-hook, graded 21 / 21 by exit-hook's own test suite — then phases that hand the terminal back last, and an onExit that reaches every exit path under one bounded deadline. - [Coming from restore-cursor](https://closeout.interlace.tools/docs/coming-from/restore-cursor): A restore-cursor alternative with a drop-in path: import restoreCursor from closeout/restore-cursor, graded 6 / 6 by restore-cursor's own test suite — then zero dependencies, and a restore phase that runs after every other exit handler. - [Coming from signal-exit](https://closeout.interlace.tools/docs/coming-from/signal-exit): A signal-exit alternative with a drop-in path: import { onExit } from closeout/signal-exit, graded 134 / 135 by signal-exit's own test suite, level with signal-exit itself — then an onExit that runs once on every exit path under a bounded deadline, and reports as --json or an agent event. - [Compatibility](https://closeout.interlace.tools/docs/drop-ins): How closeout's three drop-ins are graded — each incumbent's own test suite, unedited — the current grades, including signal-exit's 134 / 135 level with signal-exit itself, and the differences that remain. - [FAQ](https://closeout.interlace.tools/docs/faq): Short answers about closeout — SIGKILL, process.exit, async handlers, the deadline, exit codes, owning a signal, Windows, CommonJS and the drop-ins — each with where to read more. - [Getting started](https://closeout.interlace.tools/docs/getting-started): Install closeout, register one exit handler, and watch it run once on every way a Node.js program can end: exit, an emptied loop, a signal, a throw and a rejection. - [The deadline](https://closeout.interlace.tools/docs/guides/deadline): A bounded shutdown: closeout stops waiting for exit handlers after a deadline (2000 ms by default), leaves with the code it was leaving with, and names the handler that hung. - [Every exit path, exactly once](https://closeout.interlace.tools/docs/guides/exit-paths): The five ways a Node.js process ends, which ones can await, and how closeout runs each handler once when two fire together — and keeps going when one throws. - [Phases](https://closeout.interlace.tools/docs/guides/phases): flush, release, restore: closeout runs exit handlers in declared phases, each awaited before the next, so the terminal is handed back last whatever order things registered in. - [Plugins](https://closeout.interlace.tools/docs/guides/plugins): closeout's plugin host: a plugin contributes named shutdown handlers to flush or release, is validated against the family schema, reads as data before it runs, and is checked by npx closeout check. - [Reports for logs and agents](https://closeout.interlace.tools/docs/guides/reports): The shutdown as data: one record per shutdown, projected as a --json line by reportToJson and as an agent event by reportToEvent, with timedOut and the handlers that hung. - [Signals and exit status](https://closeout.interlace.tools/docs/guides/signals): How closeout leaves after a signal: it re-raises it so the process dies of SIGINT or SIGTERM rather than exiting 128 + n, keeps a crash's exit code, and stands aside when the program owns the signal. - [The terminal](https://closeout.interlace.tools/docs/guides/terminal): hideCursor, rawMode and alternateScreen: change the terminal and register the undo in one call, so a program that dies by any door — even mid-shutdown — hands back a usable terminal. - [closeout](https://closeout.interlace.tools/docs): Runs every exit handler exactly once on every path out of the process, restores the terminal, and holds shutdown to a deadline so it cannot hang. Zero dependencies. Drop-in paths for signal-exit, exit-hook, restore-cursor, cli-cursor and onetime. - [A full-screen program](https://closeout.interlace.tools/docs/recipes/full-screen-app): Raw mode, the alternate screen and a hidden cursor, set up so a Ctrl-C, a crash or a hung cleanup still hands the user their terminal back. - [A server that stops gracefully](https://closeout.interlace.tools/docs/recipes/graceful-server): Stop accepting connections on SIGTERM, flush the access log first, and still die of the signal so the orchestrator sees a clean stop — with a deadline that bounds a connection that will not close. - [Incremental migration](https://closeout.interlace.tools/docs/recipes/incremental-migration): Move from exit-hook, signal-exit or restore-cursor to closeout's own onExit a handler at a time: swap the import first, then move handlers, and know what changes when the last one moves. - [Keep the evidence on a crash](https://closeout.interlace.tools/docs/recipes/keep-evidence-on-crash): Remove a scratch directory on a clean exit and keep it when the program crashed, by reading which door the program left by. - [Testing shutdown](https://closeout.interlace.tools/docs/recipes/testing-shutdown): Test exit handlers without killing the test runner: drive a createRegistry directly, or install closeout against a fake process and assert how it was asked to leave. - [Why closeout](https://closeout.interlace.tools/docs/why-closeout): closeout against signal-exit, exit-hook and restore-cursor, one capability per row, every cell linked to the test, grade or source that proves it. ## Family - [burgee](https://burgee.interlace.tools): the family front door - [Compatibility](https://burgee.interlace.tools/docs/compatibility): Every drop-in path in the family, graded by the incumbent’s own test suite. - [Gallery](https://burgee.interlace.tools/docs/gallery): Every glyph, spinner and border the family has registered, rendered. - [Comparison](https://burgee.interlace.tools/docs/comparison): The family against its incumbents: weight, speed and surface.