SSH Shell
SSH shell is a util to manage shell commands variables and manage files upload/download. It has the same interface as local-shell to simplify usage.
Installation
Install via npm
npm i ssh-shell
Example
Example of variable usage:
const SshShell = ; const shell = username: 'user' password: '********' cwd: '/home/user'; shell;shell;
API
exec(cmd:String) -> Promise<{code,io},Error>
Execute command and return promised Result object.
open()
Added for compatibility with SshShell
Start session. Emit open
event.
close()
Added for compatibility with SshShell
Stop session. Emit close
event.
uploadFile(source:String, [dest:String]) -> Promise(<null,Error>)
Upload file from source to destination. Destination is resolving from cwd
value. If destination not set than it replaces with source's filename.
uploadBuffer(source:Buffer, dest:string) -> Promise(<null,Error>)
Upload data from buffer to the server.
downloadFile(source:String, [dest:String])
Download file from source into destination. If destination not set than it replaces with source's filename.