edgeport - v1.0.3
    Preparing search index...

    Function run

    • One-shot: connects, runs a command, decodes stdout, and closes the session.

      Throws when the command exits nonzero (message includes the exit code and stderr), the same as SshSession.run.

      Parameters

      • opts: SshConnectOptions & { command: string; trim?: boolean }

        Connect options plus the command to run and an optional trim flag.

      Returns Promise<string>

      The command's decoded stdout (trimmed unless trim is false).

      If the command exits nonzero.

      If the connection or handshake fails.

      If authentication is rejected.

      1.0.2

      import { run } from 'edgeport/ssh';
      const host = await run({ hostname: 'h', username: 'u', password: 'p', command: 'hostname' });