0.0.3 • Published 8 years ago

s9s-ssh v0.0.3

Weekly downloads
15
License
-
Repository
github
Last release
8 years ago

s9s-ssh

Promise based ssh client

Installation

npm install --save s9s-ssh

Usage

'use strict';

var Client = require(__dirname + '/../ssh');
var ssh = new Client();

ssh
    .connect({
        host: 'somehost.com',
        port: 22,
        username: 'root',
        privateKey: require('fs').readFileSync('/path/to/id_rsa')
    })
    .then(() => {
        return ssh.exec('uptime');
    })
    .then(function (result) {
        console.log(result);
    }
    .then(() => {
        return ssh.exec('whoami')
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error);
    })
    .finally(() => {
        ssh.end();
    });
0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago