Upakovka v Electron.JS no po staroy sborke cherez .cjs

This commit is contained in:
Neyra
2026-02-10 19:19:41 +08:00
parent 8e9b7201ed
commit a1bba1d3d1
442 changed files with 19825 additions and 47462 deletions

View File

@@ -1,10 +1,14 @@
export interface Options {
/**
The stream to check.
/// <reference types="node"/>
@default process.stdout
*/
readonly stream?: NodeJS.WritableStream;
declare namespace isInteractive {
interface Options {
/**
The stream to check.
@default process.stdout
*/
readonly stream?: NodeJS.WritableStream;
}
}
/**
@@ -16,10 +20,12 @@ This can be useful to decide whether to present interactive UI or animations in
@example
```
import isInteractive from 'is-interactive';
import isInteractive = require('is-interactive');
isInteractive();
//=> true
```
*/
export default function isInteractive(options?: Options): boolean;
declare function isInteractive(options?: isInteractive.Options): boolean;
export = isInteractive;

View File

@@ -1,7 +1,9 @@
export default function isInteractive({stream = process.stdout} = {}) {
'use strict';
module.exports = ({stream = process.stdout} = {}) => {
return Boolean(
stream && stream.isTTY &&
process.env.TERM !== 'dumb' &&
!('CI' in process.env)
);
}
};

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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:

View File

@@ -1,19 +1,16 @@
{
"name": "is-interactive",
"version": "2.0.0",
"version": "1.0.0",
"description": "Check if stdout or stderr is interactive",
"license": "MIT",
"repository": "sindresorhus/is-interactive",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
"url": "sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
@@ -33,9 +30,9 @@
"tty"
],
"devDependencies": {
"@types/node": "^15.0.1",
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.39.1"
"@types/node": "^12.0.12",
"ava": "^2.1.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
}
}

View File

@@ -1,4 +1,4 @@
# is-interactive
# 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)
@@ -6,21 +6,24 @@ It checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a
This can be useful to decide whether to present interactive UI or animations in the terminal.
## Install
```
$ npm install is-interactive
```
## Usage
```js
import isInteractive from 'is-interactive';
const isInteractive = require('is-interactive');
isInteractive();
//=> true
```
## API
### isInteractive(options?)
@@ -31,11 +34,12 @@ Type: `object`
##### stream
Type: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)\
Type: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)<br>
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?
@@ -45,8 +49,3 @@ It's silly to have to detect individual CIs. They should identify themselves wit
#### 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).
## Related
- [is-unicode-supported](https://github.com/sindresorhus/is-unicode-supported) - Detect whether the terminal supports Unicode
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color