Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/cli-cursor
Toggle the CLI cursor
https://github.com/sindresorhus/cli-cursor
Last synced: 28 days ago
JSON representation
Toggle the CLI cursor
- Host: GitHub
- URL: https://github.com/sindresorhus/cli-cursor
- Owner: sindresorhus
- License: mit
- Created: 2014-08-31T11:47:33.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2021-08-23T19:35:22.000Z (about 3 years ago)
- Last Synced: 2024-05-22T18:23:15.429Z (6 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 98
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs-cn - cli-cursor - 显示或关闭 CLI 光标 (包 / 命令行工具)
- awesome-nodejs-cn - cli-cursor - **star:98** 切换CLI游标 (包 / 命令行实用工具)
- awesome-nodejs - cli-cursor - Toggle the CLI cursor. (Packages / Command-line utilities)
- awesome-nodejs - cli-cursor - Toggle the CLI cursor - ★ 50 (Command-line utilities)
- awesome-node - cli-cursor - Toggle the CLI cursor. (Packages / Command-line utilities)
- awesome-nodejs-cn - cli-cursor - 切换CLI光标. (目录 / 命令行工具)
README
# cli-cursor
> Toggle the CLI cursor
The cursor is [gracefully restored](https://github.com/sindresorhus/restore-cursor) if the process exits.
## Install
```sh
npm install cli-cursor
```## Usage
```js
import cliCursor from 'cli-cursor';cliCursor.hide();
const unicornsAreAwesome = true;
cliCursor.toggle(unicornsAreAwesome);
```## API
### .show(stream?)
### .hide(stream?)
### .toggle(force?, stream?)
#### force
Useful for showing or hiding the cursor based on a boolean.
#### stream
Type: `stream.Writable`\
Default: `process.stderr`