Skip to content

Function: download() ​

ts
function download(
   source, 
   localPath, 
   options?
): Promise<TransferResult>;

Connects, downloads and disconnects in one call.

Parameters ​

ParameterType
sourcestring | RemoteTarget
localPathstring
optionsCopyOptions

Returns ​

Promise<TransferResult>

Example ​

ts
await download('root@192.168.1.1:/etc/config', './backup/config', { recursive: true, password });

Released under the MIT License.