1.0.3 • Published 3 years ago
@ankittiwaari/promise-ssh2 v1.0.3
Promisify ssh2
A simple and lightweight promise wrapper for ssh2.
Example
const promisifySSH = require('@ankittiwaari/promise-ssh2');
(async () => {
try {
let p = new promisifySSH({
host: '<host>',
user: '<user>',
password: '<password>'
});
// create connection
await p.connect();
// execute connection
let result = await p.execute('ls');
console.log('res', result);
//close connection once done
p.closeConnection();
} catch (e) {
console.log(`Error in catch `, e);
}
})();
The constructor accepts all the connection parameters accepted by connect()
method of ssh2
Raising issues
Raise all the issues at https://github.com/ankittiwaari/promise-ssh2/issues