gulp-ssh

SSH and SFTP tasks for gulp

npm install gulp-ssh
1 downloads in the last day
22 downloads in the last week
56 downloads in the last month

gulp-ssh

SSH and SFTP tasks for gulp

Install

Install with npm

npm install --save-dev gulp-ssh

Example

var gulp = require('gulp');
var ssh = require('gulp-ssh');

gulp.task('default', function () {
  ssh.exec({
    command: ['uptime', 'ls -a'],
    sshConfig: {
      host: 'angularjs.cn',
      port: 22,
      username: 'username',
      password: 'password'
    }
  })
});

API

ssh.exec(options)

options.command

Required Type: String or Array

a command string or commands array to exec.

options.sshConfig

Required Type: Object

  • host - String - Hostname or IP address of the server. Default: 'localhost'

  • port - Number - Port number of the server. Default: 22

  • username - String - Username for authentication. Default: (none)

  • password - String - Password for password-based user authentication. Default: (none)

  • privateKey - String or Buffer - Buffer or string that contains a private key for key-based user authentication (OpenSSH format). Default: (none)

More SSH Connection methods

options.ignoreErrors

Type: Boolean Default: true

Ignore errors when executing commands.


ssh.sftp(options)

TODO

License

MIT © Teambition

npm loves you