interfaces.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /// <reference types="node" />
  2. import * as stream from 'stream';
  3. /**
  4. * Interface for exec options
  5. */
  6. export interface ExecOptions {
  7. /** optional working directory. defaults to current */
  8. cwd?: string;
  9. /** optional envvar dictionary. defaults to current process's env */
  10. env?: {
  11. [key: string]: string;
  12. };
  13. /** optional. defaults to false */
  14. silent?: boolean;
  15. /** optional out stream to use. Defaults to process.stdout */
  16. outStream?: stream.Writable;
  17. /** optional err stream to use. Defaults to process.stderr */
  18. errStream?: stream.Writable;
  19. /** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */
  20. windowsVerbatimArguments?: boolean;
  21. /** optional. whether to fail if output to stderr. defaults to false */
  22. failOnStdErr?: boolean;
  23. /** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
  24. ignoreReturnCode?: boolean;
  25. /** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
  26. delay?: number;
  27. /** optional. Listeners for output. Callback functions that will be called on these events */
  28. listeners?: {
  29. stdout?: (data: Buffer) => void;
  30. stderr?: (data: Buffer) => void;
  31. stdline?: (data: string) => void;
  32. errline?: (data: string) => void;
  33. debug?: (data: string) => void;
  34. };
  35. }