Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
restore-cursor
Advanced tools
The restore-cursor npm package is designed to restore the CLI cursor when a Node.js application exits. It ensures that the cursor is visible and functioning correctly after the application has finished running, which is particularly useful for CLI tools that manipulate the cursor visibility.
Restoring cursor on exit
This feature ensures that the cursor is restored when the process exits, either normally or due to an error. The code sample demonstrates how to use the package to automatically restore the cursor when the process exits.
const restoreCursor = require('restore-cursor');
restoreCursor();
The cli-cursor package allows for showing and hiding the cursor in the terminal. It provides more granular control compared to restore-cursor, which is focused on restoring the cursor state upon exit.
While not specifically focused on cursor restoration, on-exit-leak-free allows you to run cleanup code when a process exits. It could be used in conjunction with cursor manipulation code to achieve a similar effect to restore-cursor.
Gracefully restore the CLI cursor on exit
Prevent the cursor you have hidden interactively from remaining hidden if the process crashes.
It does nothing if run in a non-TTY context.
npm install restore-cursor
import restoreCursor from 'restore-cursor';
restoreCursor();
FAQs
Gracefully restore the CLI cursor on exit
The npm package restore-cursor receives a total of 34,121,029 weekly downloads. As such, restore-cursor popularity was classified as popular.
We found that restore-cursor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.