Back to Gems
sindresorhus/cli-cursor(opens in a new tab)
Language: JavaScript
Toggle the CLI cursor
- stars
- 115
- watchers
- 4
- forks
- 7
- open issues
- 0
- Last updated
- 09/19/2026
Language: JavaScript
Toggle the CLI cursor
Toggle the CLI cursor
The cursor is gracefully restored if the process exits.
npm install cli-cursor
import cliCursor from 'cli-cursor'; cliCursor.hide(); const unicornsAreAwesome = true; cliCursor.toggle(unicornsAreAwesome);
Useful for showing or hiding the cursor based on a boolean.
Type: stream.Writable
Default: process.stderr