{"library":"restore-cursor","title":"restore-cursor","description":"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).","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install restore-cursor"],"cli":null},"imports":["import restoreCursor from 'restore-cursor'","import restoreCursor from 'restore-cursor'","import restoreCursor from 'restore-cursor'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import restoreCursor from 'restore-cursor';\n\n// Hide cursor (e.g., for a spinner)\nprocess.stdout.write('\\u001B[?25l');\n\n// ... do work (if the process crashes, cursor is restored automatically)\n\n// Restore cursor manually\nrestoreCursor();\n\n// Or let the cleanup happen on exit","lang":"typescript","description":"Shows how to import and call restoreCursor to gracefully restore the cursor on exit. Demonstrates manual restore and automatic cleanup.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}