feat: initial commit
This commit is contained in:
45
node_modules/cli-cursor/index.d.ts
generated
vendored
45
node_modules/cli-cursor/index.d.ts
generated
vendored
@ -1,45 +0,0 @@
|
||||
/// <reference types="node"/>
|
||||
|
||||
/**
|
||||
Show cursor.
|
||||
|
||||
@param stream - Default: `process.stderr`.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as cliCursor from 'cli-cursor';
|
||||
|
||||
cliCursor.show();
|
||||
```
|
||||
*/
|
||||
export function show(stream?: NodeJS.WritableStream): void;
|
||||
|
||||
/**
|
||||
Hide cursor.
|
||||
|
||||
@param stream - Default: `process.stderr`.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as cliCursor from 'cli-cursor';
|
||||
|
||||
cliCursor.hide();
|
||||
```
|
||||
*/
|
||||
export function hide(stream?: NodeJS.WritableStream): void;
|
||||
|
||||
/**
|
||||
Toggle cursor visibility.
|
||||
|
||||
@param force - Is useful to show or hide the cursor based on a boolean.
|
||||
@param stream - Default: `process.stderr`.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as cliCursor from 'cli-cursor';
|
||||
|
||||
const unicornsAreAwesome = true;
|
||||
cliCursor.toggle(unicornsAreAwesome);
|
||||
```
|
||||
*/
|
||||
export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void;
|
32
node_modules/cli-cursor/index.js
generated
vendored
32
node_modules/cli-cursor/index.js
generated
vendored
@ -1,35 +1,39 @@
|
||||
'use strict';
|
||||
const restoreCursor = require('restore-cursor');
|
||||
|
||||
let isHidden = false;
|
||||
let hidden = false;
|
||||
|
||||
exports.show = (writableStream = process.stderr) => {
|
||||
if (!writableStream.isTTY) {
|
||||
exports.show = stream => {
|
||||
const s = stream || process.stderr;
|
||||
|
||||
if (!s.isTTY) {
|
||||
return;
|
||||
}
|
||||
|
||||
isHidden = false;
|
||||
writableStream.write('\u001B[?25h');
|
||||
hidden = false;
|
||||
s.write('\u001b[?25h');
|
||||
};
|
||||
|
||||
exports.hide = (writableStream = process.stderr) => {
|
||||
if (!writableStream.isTTY) {
|
||||
exports.hide = stream => {
|
||||
const s = stream || process.stderr;
|
||||
|
||||
if (!s.isTTY) {
|
||||
return;
|
||||
}
|
||||
|
||||
restoreCursor();
|
||||
isHidden = true;
|
||||
writableStream.write('\u001B[?25l');
|
||||
hidden = true;
|
||||
s.write('\u001b[?25l');
|
||||
};
|
||||
|
||||
exports.toggle = (force, writableStream) => {
|
||||
exports.toggle = (force, stream) => {
|
||||
if (force !== undefined) {
|
||||
isHidden = force;
|
||||
hidden = force;
|
||||
}
|
||||
|
||||
if (isHidden) {
|
||||
exports.show(writableStream);
|
||||
if (hidden) {
|
||||
exports.show(stream);
|
||||
} else {
|
||||
exports.hide(writableStream);
|
||||
exports.hide(stream);
|
||||
}
|
||||
};
|
||||
|
20
node_modules/cli-cursor/license
generated
vendored
20
node_modules/cli-cursor/license
generated
vendored
@ -1,9 +1,21 @@
|
||||
MIT License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
88
node_modules/cli-cursor/package.json
generated
vendored
88
node_modules/cli-cursor/package.json
generated
vendored
@ -1,46 +1,46 @@
|
||||
{
|
||||
"name": "cli-cursor",
|
||||
"version": "3.1.0",
|
||||
"description": "Toggle the CLI cursor",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/cli-cursor",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"cli",
|
||||
"cursor",
|
||||
"ansi",
|
||||
"toggle",
|
||||
"display",
|
||||
"show",
|
||||
"hide",
|
||||
"term",
|
||||
"terminal",
|
||||
"console",
|
||||
"tty",
|
||||
"shell",
|
||||
"command-line"
|
||||
],
|
||||
"dependencies": {
|
||||
"restore-cursor": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.7",
|
||||
"ava": "^2.1.0",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
"name": "cli-cursor",
|
||||
"version": "2.1.0",
|
||||
"description": "Toggle the CLI cursor",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/cli-cursor",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"cli",
|
||||
"cursor",
|
||||
"ansi",
|
||||
"toggle",
|
||||
"display",
|
||||
"show",
|
||||
"hide",
|
||||
"term",
|
||||
"terminal",
|
||||
"console",
|
||||
"tty",
|
||||
"shell",
|
||||
"command-line"
|
||||
],
|
||||
"dependencies": {
|
||||
"restore-cursor": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
|
26
node_modules/cli-cursor/readme.md
generated
vendored
26
node_modules/cli-cursor/readme.md
generated
vendored
@ -8,7 +8,7 @@ The cursor is [gracefully restored](https://github.com/sindresorhus/restore-curs
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install cli-cursor
|
||||
$ npm install --save cli-cursor
|
||||
```
|
||||
|
||||
|
||||
@ -26,30 +26,20 @@ cliCursor.toggle(unicornsAreAwesome);
|
||||
|
||||
## API
|
||||
|
||||
### .show(stream?)
|
||||
### .show([stream])
|
||||
|
||||
### .hide(stream?)
|
||||
### .hide([stream])
|
||||
|
||||
### .toggle(force?, stream?)
|
||||
### .toggle(force, [stream])
|
||||
|
||||
#### force
|
||||
|
||||
Useful for showing or hiding the cursor based on a boolean.
|
||||
`force` is useful to show or hide the cursor based on a boolean.
|
||||
|
||||
#### stream
|
||||
|
||||
Type: `stream.Writable`<br>
|
||||
Type: `Stream`<br>
|
||||
Default: `process.stderr`
|
||||
|
||||
|
||||
---
|
||||
## License
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-cli-cursor?utm_source=npm-cli-cursor&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
Reference in New Issue
Block a user