Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
717 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /// <reference types="node"/>
|
---|
| 2 |
|
---|
| 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 | }
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | /**
|
---|
| 15 | Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678).
|
---|
| 16 |
|
---|
| 17 | 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.
|
---|
| 18 |
|
---|
| 19 | This can be useful to decide whether to present interactive UI or animations in the terminal.
|
---|
| 20 |
|
---|
| 21 | @example
|
---|
| 22 | ```
|
---|
| 23 | import isInteractive = require('is-interactive');
|
---|
| 24 |
|
---|
| 25 | isInteractive();
|
---|
| 26 | //=> true
|
---|
| 27 | ```
|
---|
| 28 | */
|
---|
| 29 | declare function isInteractive(options?: isInteractive.Options): boolean;
|
---|
| 30 |
|
---|
| 31 | export = isInteractive;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.