Documentation
    Preparing search index...

    Fluent builder for launching and managing system subprocesses. Supports cross-platform execution and shell redirection (e.g. PowerShell).

    Index

    Constructors

    • Instantiate a new Command.

      Parameters

      • bin: string

        Name or path of the binary/command.

      Returns Command

    Methods

    • Add a single command-line argument.

      Parameters

      • value: string

        Argument string.

      Returns this

    • Add multiple command-line arguments.

      Parameters

      • values: string[]

        List of argument strings.

      Returns this

    • Set the working directory for the subprocess.

      Parameters

      • dir: string

        Absolute or relative directory path.

      Returns this

    • Set or extend environment variables for the subprocess.

      Parameters

      • vars: Record<string, string>

        Key-value dictionary of environment variables.

      Returns this

    • Execute the configured command and return a Promise resolving on process exit.

      Returns Promise<
          {
              code: number
              | null;
              stderr: string;
              stdout: string;
              success: boolean;
          },
      >

      Promise resolving with standard output, error streams, and status.

    • Configure the subprocess to inherit stdout and stderr from the parent process.

      Returns this

    • Enable executing the command via PowerShell (powershell.exe or pwsh).

      Parameters

      • use: boolean = true

        Whether to use PowerShell.

      • type: "powershell" | "pwsh" = 'powershell'

        Shell binary choice ('powershell' or 'pwsh').

      Returns this

    • Static factory to instantiate a new Command.

      Parameters

      • bin: string

        Name or path of the binary/command.

      Returns Command