New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-ssh

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ssh

SSH and SFTP tasks for gulp

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-ssh v0.2.2

SSH and SFTP tasks for gulp

Install

Install with npm

npm install --save-dev gulp-ssh

Example

var gulp = require('gulp');
var gulpSSH = require('gulp-ssh')({
  ignoreErrors: false,
  sshConfig: {
    host: 'angularjs.cn',
    port: 22,
    username: 'root',
    privateKey: require('fs').readFileSync('/Users/zensh/.ssh/id_rsa')
  }
});

// execute commands
gulp.task('exec', function () {
  return gulpSSH
    .exec(['uptime', 'ls -a', 'pwd'], {filePath: 'commands.log'})
    .pipe(gulp.dest('logs'));
});

// get file from server and write to local
gulp.task('sftp-read', function () {
  return gulpSSH.sftp('read', 'pm2.json')
    .pipe(gulp.dest(''));
});

// put local file to server
gulp.task('sftp-write', function () {
  return gulp.src('index.js')
    .pipe(gulpSSH.sftp('write', 'test.js'));
});

API

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

GulpSSH(options)

var gulpSSH = new GulpSSH(options);
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

Ignore errors when executing commands.. Default: (false)


gulpSSH.connect(sshConfig)

return gulpSSH

gulpSSH.exec(commands, options)

return stream

commands

Required Type: String or Array

options.filePath

Option Type: String

file path to write on local. Default: ('commands.log')

gulpSSH.sftp(command, filePath, options)

return stream

command

Required Type: String Value: 'read' or 'write'

filePath

Required Type: String

file path to read or write on server. Default: (none)

options

Option Type: Object

License

MIT © Teambition

Keywords

FAQs

Package last updated on 16 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc