From 46e43f4bde4a35785b4997b81e86cd19f046b69b Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 21 Dec 2021 16:52:28 +0100 Subject: Commit --- node_modules/is-interactive/index.d.ts | 31 ++++++++++++++ node_modules/is-interactive/index.js | 9 ++++ node_modules/is-interactive/license | 9 ++++ node_modules/is-interactive/package.json | 70 ++++++++++++++++++++++++++++++++ node_modules/is-interactive/readme.md | 51 +++++++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 node_modules/is-interactive/index.d.ts create mode 100644 node_modules/is-interactive/index.js create mode 100644 node_modules/is-interactive/license create mode 100644 node_modules/is-interactive/package.json create mode 100644 node_modules/is-interactive/readme.md (limited to 'node_modules/is-interactive') diff --git a/node_modules/is-interactive/index.d.ts b/node_modules/is-interactive/index.d.ts new file mode 100644 index 0000000..5984dc6 --- /dev/null +++ b/node_modules/is-interactive/index.d.ts @@ -0,0 +1,31 @@ +/// + +declare namespace isInteractive { + interface Options { + /** + The stream to check. + + @default process.stdout + */ + readonly stream?: NodeJS.WritableStream; + } +} + +/** +Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678). + +It checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a-tty/), not a dumb terminal, and not running in a CI. + +This can be useful to decide whether to present interactive UI or animations in the terminal. + +@example +``` +import isInteractive = require('is-interactive'); + +isInteractive(); +//=> true +``` +*/ +declare function isInteractive(options?: isInteractive.Options): boolean; + +export = isInteractive; diff --git a/node_modules/is-interactive/index.js b/node_modules/is-interactive/index.js new file mode 100644 index 0000000..99ff823 --- /dev/null +++ b/node_modules/is-interactive/index.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = ({stream = process.stdout} = {}) => { + return Boolean( + stream && stream.isTTY && + process.env.TERM !== 'dumb' && + !('CI' in process.env) + ); +}; diff --git a/node_modules/is-interactive/license b/node_modules/is-interactive/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/is-interactive/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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/node_modules/is-interactive/package.json b/node_modules/is-interactive/package.json new file mode 100644 index 0000000..e6c1993 --- /dev/null +++ b/node_modules/is-interactive/package.json @@ -0,0 +1,70 @@ +{ + "_from": "is-interactive@^1.0.0", + "_id": "is-interactive@1.0.0", + "_inBundle": false, + "_integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "_location": "/is-interactive", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-interactive@^1.0.0", + "name": "is-interactive", + "escapedName": "is-interactive", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/ora" + ], + "_resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "_shasum": "cea6e6ae5c870a7b0a0004070b7b587e0252912e", + "_spec": "is-interactive@^1.0.0", + "_where": "/mnt/n/Projets/langdetect/node_modules/ora", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-interactive/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if stdout or stderr is interactive", + "devDependencies": { + "@types/node": "^12.0.12", + "ava": "^2.1.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/is-interactive#readme", + "keywords": [ + "interactive", + "stdout", + "stderr", + "detect", + "is", + "terminal", + "shell", + "tty" + ], + "license": "MIT", + "name": "is-interactive", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-interactive.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "1.0.0" +} diff --git a/node_modules/is-interactive/readme.md b/node_modules/is-interactive/readme.md new file mode 100644 index 0000000..49a8598 --- /dev/null +++ b/node_modules/is-interactive/readme.md @@ -0,0 +1,51 @@ +# is-interactive [![Build Status](https://travis-ci.com/sindresorhus/is-interactive.svg?branch=master)](https://travis-ci.com/sindresorhus/is-interactive) + +> Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678) + +It checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a-tty/), not a dumb terminal, and not running in a CI. + +This can be useful to decide whether to present interactive UI or animations in the terminal. + + +## Install + +``` +$ npm install is-interactive +``` + + +## Usage + +```js +const isInteractive = require('is-interactive'); + +isInteractive(); +//=> true +``` + + +## API + +### isInteractive(options?) + +#### options + +Type: `object` + +##### stream + +Type: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)
+Default: [`process.stdout`](https://nodejs.org/api/process.html#process_process_stdout) + +The stream to check. + + +## FAQ + +#### Why are you not using [`ci-info`](https://github.com/watson/ci-info) for the CI check? + +It's silly to have to detect individual CIs. They should identify themselves with the `CI` environment variable, and most do just that. A manually maintained list of detections will easily get out of date. And if a package using `ci-info` doesn't update to the latest version all the time, they will not support certain CIs. It also creates unpredictability as you might assume a CI is not supported and then suddenly it gets supported and you didn't account for that. In addition, some of the manual detections are loose and might cause false-positives which could create hard-to-debug bugs. + +#### Why does this even exist? It's just a few lines. + +It's not about the number of lines, but rather discoverability and documentation. A lot of people wouldn't even know they need this. Feel free to copy-paste the code if you don't want the dependency. You might also want to read [this blog post](https://blog.sindresorhus.com/small-focused-modules-9238d977a92a). -- cgit