Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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 45,873,323 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.