Socket
Socket
Sign inDemoInstall

cli-cursor

Package Overview
Dependencies
4
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cli-cursor

Toggle the CLI cursor


Version published
Weekly downloads
38M
decreased by-0.33%
Maintainers
1
Install size
26.2 kB
Created
Weekly downloads
 

Package description

What is cli-cursor?

The cli-cursor npm package allows developers to show or hide the cursor in command-line interfaces. This can be useful when creating CLI tools or applications that require a clean, distraction-free interface, or when the cursor needs to be temporarily hidden during spinner animations or other CLI graphics.

What are cli-cursor's main functionalities?

Hide Cursor

This feature hides the cursor in the terminal. It is useful when you want to prevent the cursor from interfering with CLI graphics or output.

const cliCursor = require('cli-cursor');
cliCursor.hide(process.stdout);

Show Cursor

This feature shows the cursor in the terminal after it has been hidden. It is useful for restoring the cursor once a CLI operation that required hiding it is complete.

const cliCursor = require('cli-cursor');
cliCursor.show(process.stdout);

Toggle Cursor

This feature toggles the visibility of the cursor based on a boolean value. It provides a convenient way to switch between showing and hiding the cursor.

const cliCursor = require('cli-cursor');
const isVisible = true; // This should be a dynamic value based on the current cursor state
cliCursor.toggle(process.stdout, isVisible);

Other packages similar to cli-cursor

Readme

Source

cli-cursor Build Status

Toggle the CLI cursor

The cursor is gracefully restored if the process exits.

Install

$ npm install --save cli-cursor

Usage

const cliCursor = require('cli-cursor');

cliCursor.hide();

const unicornsAreAwesome = true;
cliCursor.toggle(unicornsAreAwesome);

API

.show([stream])

.hide([stream])

.toggle(force, [stream])

force is useful to show or hide the cursor based on a boolean.

stream

Type: Stream
Default: process.stderr

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 09 Jan 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc