# cli-cursor

> Toggle the CLI cursor

Latest version **5.0.0** (published 2024-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install cli-cursor
pnpm add cli-cursor
yarn add cli-cursor
bun add cli-cursor
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2024-07-26 |
| First published | 2014-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 114 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | cli, cursor, ansi, toggle, display, show, hide, term, terminal, console, tty, shell, command-line |

## Links

- npm: https://www.npmjs.com/package/cli-cursor
- Repository: https://github.com/sindresorhus/cli-cursor
- Homepage: https://github.com/sindresorhus/cli-cursor#readme
- Issues: https://github.com/sindresorhus/cli-cursor/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/cli-cursor

## Dependencies (1)

- [restore-cursor](https://npm.io/package/restore-cursor.md) ^5.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2024-07-26
- 4.0.0 — 2021-08-23
- 3.1.0 — 2019-06-11
- 3.0.0 — 2019-04-09
- 2.1.0 — 2017-01-09
- 2.0.0 — 2017-01-09
- 1.0.2 — 2015-09-18
- 1.0.1 — 2014-08-31
- 1.0.0 — 2014-08-31

## 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`

---
_Source: https://npm.io/package/cli-cursor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
