mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
Update ESLint and configuration to version 4.0.0. Backport-PR-URL: https://github.com/nodejs/node/pull/14340 PR-URL: https://github.com/nodejs/node/pull/13645 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
46 lines
752 B
Markdown
46 lines
752 B
Markdown
# cli-cursor [](https://travis-ci.org/sindresorhus/cli-cursor)
|
|
|
|
> Toggle the CLI cursor
|
|
|
|
The cursor is [gracefully restored](https://github.com/sindresorhus/restore-cursor) if the process exits.
|
|
|
|
|
|
## Install
|
|
|
|
```
|
|
$ npm install --save cli-cursor
|
|
```
|
|
|
|
|
|
## Usage
|
|
|
|
```js
|
|
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`<br>
|
|
Default: `process.stderr`
|
|
|
|
|
|
## License
|
|
|
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|