Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 21,712,456 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.