edgeport - v1.0.3
    Preparing search index...

    Function exec

    • Runs a single command over a fresh connection and returns its output.

      Parameters

      • opts: SshConnectOptions & { command: string }

        Connection options plus the command to run.

      Returns Promise<ExecResult>

      The command's stdout, stderr, and exit code.

      1.0.0

      import { exec } from 'edgeport/ssh';
      const { stdout, code } = await exec({ hostname: 'h', username: 'u', password: 'p', command: 'whoami' });