is-interactive
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,12 +0,8 @@ | ||
/// <reference types="node"/> | ||
export interface Options { | ||
/** | ||
The stream to check. | ||
declare namespace isInteractive { | ||
interface Options { | ||
/** | ||
The stream to check. | ||
@default process.stdout | ||
*/ | ||
readonly stream?: NodeJS.WritableStream; | ||
} | ||
@default process.stdout | ||
*/ | ||
readonly stream?: NodeJS.WritableStream; | ||
} | ||
@@ -23,3 +19,3 @@ | ||
``` | ||
import isInteractive = require('is-interactive'); | ||
import isInteractive from 'is-interactive'; | ||
@@ -30,4 +26,2 @@ isInteractive(); | ||
*/ | ||
declare function isInteractive(options?: isInteractive.Options): boolean; | ||
export = isInteractive; | ||
export default function isInteractive(options?: Options): boolean; |
@@ -1,4 +0,2 @@ | ||
'use strict'; | ||
module.exports = ({stream = process.stdout} = {}) => { | ||
export default function isInteractive({stream = process.stdout} = {}) { | ||
return Boolean( | ||
@@ -9,2 +7,2 @@ stream && stream.isTTY && | ||
); | ||
}; | ||
} |
{ | ||
"name": "is-interactive", | ||
"version": "1.0.0", | ||
"version": "2.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": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=12" | ||
}, | ||
@@ -33,7 +36,7 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/node": "^12.0.12", | ||
"ava": "^2.1.0", | ||
"tsd": "^0.7.3", | ||
"xo": "^0.24.0" | ||
"@types/node": "^15.0.1", | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.39.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# is-interactive [![Build Status](https://travis-ci.com/sindresorhus/is-interactive.svg?branch=master)](https://travis-ci.com/sindresorhus/is-interactive) | ||
# is-interactive | ||
@@ -9,3 +9,2 @@ > Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678) | ||
## Install | ||
@@ -17,7 +16,6 @@ | ||
## Usage | ||
```js | ||
const isInteractive = require('is-interactive'); | ||
import isInteractive from 'is-interactive'; | ||
@@ -28,3 +26,2 @@ isInteractive(); | ||
## API | ||
@@ -40,3 +37,3 @@ | ||
Type: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)<br> | ||
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) | ||
@@ -46,3 +43,2 @@ | ||
## FAQ | ||
@@ -57,1 +53,6 @@ | ||
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 |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4726
53
Yes
26