Gracefully restore the CLI cursor on exit. The package automatically restores the cursor when a process exits, preventing hidden cursors from remaining hidden after crashes or interruptions. Latest version 5.1.0, maintained by Sindre Sorhus. Releases are stable and infrequent. Key differentiators: zero dependencies (v5+), proper TTY detection (no-op in non-TTY contexts), and simple imperative API. Pure ESM from v4, requires Node.js >=18 (v5).
npm install restore-cursorVerified import paths — ran on the pinned version, not inferred.
Shows how to import and call restoreCursor to gracefully restore the cursor on exit. Demonstrates manual restore and automatic cleanup.
Use dynamic import() or switch to ES modules.
Upgrade Node.js to >=18 or use v4.x (which requires Node.js 12.20).
If you rely on cursor restore in non-TTY contexts, you may need to handle that manually.
No action needed; it is idempotent.
Use dynamic import: const restoreCursor = (await import('restore-cursor')).default;Set "type": "module" in package.json or use .mjs extension.
No dependency data recorded yet.