Commit bd35f29 1 parent d60b613 commit bd35f29 Copy full SHA for bd35f29
File tree 8 files changed +24
-34
lines changed
8 files changed +24
-34
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ jobs:
10
10
fail-fast : false
11
11
matrix :
12
12
node-version :
13
+ - 16
13
14
- 14
14
15
- 12
15
- - 10
16
- - 8
17
16
steps :
18
17
- uses : actions/checkout@v2
19
- - uses : actions/setup-node@v1
18
+ - uses : actions/setup-node@v2
20
19
with :
21
20
node-version : ${{ matrix.node-version }}
22
21
- run : npm install
Original file line number Diff line number Diff line change 1
- /// <reference types="node"/>
1
+ export interface Options {
2
+ /**
3
+ The stream to check.
2
4
3
- declare namespace isInteractive {
4
- interface Options {
5
- /**
6
- The stream to check.
7
-
8
- @default process.stdout
9
- */
10
- readonly stream ?: NodeJS . WritableStream ;
11
- }
5
+ @default process.stdout
6
+ */
7
+ readonly stream ?: NodeJS . WritableStream ;
12
8
}
13
9
14
10
/**
@@ -20,12 +16,10 @@ This can be useful to decide whether to present interactive UI or animations in
20
16
21
17
@example
22
18
```
23
- import isInteractive = require( 'is-interactive') ;
19
+ import isInteractive from 'is-interactive';
24
20
25
21
isInteractive();
26
22
//=> true
27
23
```
28
24
*/
29
- declare function isInteractive ( options ?: isInteractive . Options ) : boolean ;
30
-
31
- export = isInteractive ;
25
+ export default function isInteractive ( options ?: Options ) : boolean ;
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
- module . exports = ( { stream = process . stdout } = { } ) => {
1
+ export default function isInteractive ( { stream = process . stdout } = { } ) {
4
2
return Boolean (
5
3
stream && stream . isTTY &&
6
4
process . env . TERM !== 'dumb' &&
7
5
! ( 'CI' in process . env )
8
6
) ;
9
- } ;
7
+ }
Original file line number Diff line number Diff line change 1
1
import { expectType } from 'tsd' ;
2
- import isInteractive = require ( '.' ) ;
2
+ import isInteractive from './index.js' ;
3
3
4
4
expectType < boolean > ( isInteractive ( {
5
5
stream : process . stderr
Original file line number Diff line number Diff line change 10
10
"email" : " sindresorhus@gmail.com" ,
11
11
"url" : " https://sindresorhus.com"
12
12
},
13
+ "type" : " module" ,
14
+ "exports" : " ./index.js" ,
13
15
"engines" : {
14
- "node" : " >=8 "
16
+ "node" : " >=12 "
15
17
},
16
18
"scripts" : {
17
19
"test" : " xo && ava && tsd"
31
33
" tty"
32
34
],
33
35
"devDependencies" : {
34
- "@types/node" : " ^12 .0.12 " ,
35
- "ava" : " ^2.1 .0" ,
36
- "tsd" : " ^0.7.3 " ,
37
- "xo" : " ^0.24.0 "
36
+ "@types/node" : " ^15 .0.1 " ,
37
+ "ava" : " ^3.15 .0" ,
38
+ "tsd" : " ^0.14.0 " ,
39
+ "xo" : " ^0.39.1 "
38
40
}
39
41
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ $ npm install is-interactive
15
15
## Usage
16
16
17
17
``` js
18
- const isInteractive = require ( ' is-interactive' ) ;
18
+ import isInteractive from ' is-interactive' ;
19
19
20
20
isInteractive ();
21
21
// => true
@@ -31,7 +31,7 @@ Type: `object`
31
31
32
32
##### stream
33
33
34
- Type: [ ` stream.Writable ` ] ( https://nodejs.org/api/stream.html#stream_class_stream_writable ) < br >
34
+ Type: [ ` stream.Writable ` ] ( https://nodejs.org/api/stream.html#stream_class_stream_writable ) \
35
35
Default: [ ` process.stdout ` ] ( https://nodejs.org/api/process.html#process_process_stdout )
36
36
37
37
The stream to check.
Original file line number Diff line number Diff line change 1
- import { PassThrough as PassThroughStream } from 'stream' ;
1
+ import { PassThrough as PassThroughStream } from 'node: stream' ;
2
2
import test from 'ava' ;
3
- import isInteractive from '.' ;
3
+ import isInteractive from './index.js ' ;
4
4
5
5
test ( 'tty' , t => {
6
6
const ci = process . env . CI ;
You can’t perform that action at this time.
0 commit comments