summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/cli-cursor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/cli-cursor')
-rw-r--r--tools/node_modules/eslint/node_modules/cli-cursor/index.js39
-rw-r--r--tools/node_modules/eslint/node_modules/cli-cursor/license21
-rw-r--r--tools/node_modules/eslint/node_modules/cli-cursor/package.json78
-rw-r--r--tools/node_modules/eslint/node_modules/cli-cursor/readme.md45
4 files changed, 183 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/index.js b/tools/node_modules/eslint/node_modules/cli-cursor/index.js
new file mode 100644
index 0000000000..6284a82896
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/cli-cursor/index.js
@@ -0,0 +1,39 @@
+'use strict';
+const restoreCursor = require('restore-cursor');
+
+let hidden = false;
+
+exports.show = stream => {
+ const s = stream || process.stderr;
+
+ if (!s.isTTY) {
+ return;
+ }
+
+ hidden = false;
+ s.write('\u001b[?25h');
+};
+
+exports.hide = stream => {
+ const s = stream || process.stderr;
+
+ if (!s.isTTY) {
+ return;
+ }
+
+ restoreCursor();
+ hidden = true;
+ s.write('\u001b[?25l');
+};
+
+exports.toggle = (force, stream) => {
+ if (force !== undefined) {
+ hidden = force;
+ }
+
+ if (hidden) {
+ exports.show(stream);
+ } else {
+ exports.hide(stream);
+ }
+};
diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/license b/tools/node_modules/eslint/node_modules/cli-cursor/license
new file mode 100644
index 0000000000..654d0bfe94
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/cli-cursor/license
@@ -0,0 +1,21 @@
+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:
+
+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.
diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/package.json b/tools/node_modules/eslint/node_modules/cli-cursor/package.json
new file mode 100644
index 0000000000..f8cd465948
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/cli-cursor/package.json
@@ -0,0 +1,78 @@
+{
+ "_from": "cli-cursor@^2.1.0",
+ "_id": "cli-cursor@2.1.0",
+ "_inBundle": false,
+ "_integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
+ "_location": "/eslint/cli-cursor",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "cli-cursor@^2.1.0",
+ "name": "cli-cursor",
+ "escapedName": "cli-cursor",
+ "rawSpec": "^2.1.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.1.0"
+ },
+ "_requiredBy": [
+ "/eslint/inquirer"
+ ],
+ "_resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+ "_shasum": "b35dac376479facc3e94747d41d0d0f5238ffcb5",
+ "_spec": "cli-cursor@^2.1.0",
+ "_where": "/Users/cjihrig/iojs/node/tools/eslint-tmp/node_modules/eslint/node_modules/inquirer",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/cli-cursor/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "restore-cursor": "^2.0.0"
+ },
+ "deprecated": false,
+ "description": "Toggle the CLI cursor",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/cli-cursor#readme",
+ "keywords": [
+ "cli",
+ "cursor",
+ "ansi",
+ "toggle",
+ "display",
+ "show",
+ "hide",
+ "term",
+ "terminal",
+ "console",
+ "tty",
+ "shell",
+ "command-line"
+ ],
+ "license": "MIT",
+ "name": "cli-cursor",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/cli-cursor.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "2.1.0",
+ "xo": {
+ "esnext": true
+ }
+}
diff --git a/tools/node_modules/eslint/node_modules/cli-cursor/readme.md b/tools/node_modules/eslint/node_modules/cli-cursor/readme.md
new file mode 100644
index 0000000000..75c18e5fea
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/cli-cursor/readme.md
@@ -0,0 +1,45 @@
+# cli-cursor [![Build Status](https://travis-ci.org/sindresorhus/cli-cursor.svg?branch=master)](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)