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.
Connect options plus the command to run and an optional trim flag.
command
trim
The command's decoded stdout (trimmed unless trim is false).
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' }); Copy
import { run } from 'edgeport/ssh';const host = await run({ hostname: 'h', username: 'u', password: 'p', command: 'hostname' });
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.