index.d.ts 717 B

12345678910111213141516171819202122232425262728293031
  1. /// <reference types="node"/>
  2. declare namespace isInteractive {
  3. interface Options {
  4. /**
  5. The stream to check.
  6. @default process.stdout
  7. */
  8. readonly stream?: NodeJS.WritableStream;
  9. }
  10. }
  11. /**
  12. Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678).
  13. 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.
  14. This can be useful to decide whether to present interactive UI or animations in the terminal.
  15. @example
  16. ```
  17. import isInteractive = require('is-interactive');
  18. isInteractive();
  19. //=> true
  20. ```
  21. */
  22. declare function isInteractive(options?: isInteractive.Options): boolean;
  23. export = isInteractive;