ssh-promise
ssh-promise is a simple when promise wrapper around ssh2 for node.js.
Usage
Executing a single ssh command
var Client = ; // The config passed to the Client constructor should match the config required by ssh2var config = host: '192.168.100.100' username: 'ubuntu' privateKey: // The Client constructor can also take an optional logger.// This is any object which has both an info() and error() functions e.g. a bunyan logger.// If a logger is not provided, console will be used.var ssh = config logger; // Execute the command and once complete, the then function will be calledssh ;
Executing multiple ssh commands
var Client = ; // The config passed to the Client constructor should match the config required by ssh2var ssh = host: '192.168.100.100' username: 'ubuntu' privateKey: ; commands = 'mkdir test' 'echo "ssh-promise is awesome!" >> test/ssh.txt'; // Execute the commands and once all commands are complete, the then function will be calledssh ;