Function: connect()
ts
function connect(options): Promise<ScpClient>;Opens an SSH connection and picks the transfer protocol.
Parameters
| Parameter | Type |
|---|---|
options | ConnectOptions |
Returns
Promise<ScpClient>
Example
ts
const client = await connect({ host: '10.0.0.1', username: 'root', privateKey });
await client.upload('./dist', '/www', { recursive: true });
await client.close();