Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ssh

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ssh - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

#### 4.2.0
- Fix a typo in README
- Add support for passing direct options to `ssh2.exec`
#### 4.1.0

@@ -2,0 +7,0 @@

5

lib/index.js

@@ -162,2 +162,4 @@ 'use strict';

(0, _assert2.default)(!options.stream || ['stdout', 'stderr', 'both'].indexOf(options.stream) !== -1, 'options.stream must be among "stdout", "stderr" and "both"');
(0, _assert2.default)(!options.options || _typeof(options.options) === 'object', 'options.options must be an object');
var output = yield this.execCommand([command].concat((0, _shellEscape2.default)(parameters)).join(' '), options);

@@ -194,2 +196,3 @@ if (!options.stream || options.stream === 'stdout') {

(0, _assert2.default)(!options.stdin || typeof options.stdin === 'string', 'options.stdin must be a string');
(0, _assert2.default)(!options.options || _typeof(options.options) === 'object', 'options.options must be an object');

@@ -216,3 +219,3 @@ if (options.cwd) {

});
}, reject));
}, reject), options.options || {});
});

@@ -219,0 +222,0 @@ });

2

package.json
{
"name": "node-ssh",
"version": "4.1.0",
"version": "4.2.0",
"description": "SS2 with Promises",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -71,4 +71,4 @@ Node-SSH - SSH2 with Promises

}
}).then(function(successful) {
console.log('the directory transfer was', successful ? 'successful' : 'unsuccessful')
}).then(function(status) {
console.log('the directory transfer was', status ? 'successful' : 'unsuccessful')
console.log('failed transfers', failed.join(', '))

@@ -83,3 +83,3 @@ console.log('successful transfers', successful.join(', '))

// Command with escaped params
ssh.exec('hh_client', ['--json'], { cwd: '/var/www', stream: 'stdout' }).then(function(result) {
ssh.exec('hh_client', ['--json'], { cwd: '/var/www', stream: 'stdout', options: { pty: true } }).then(function(result) {
console.log('STDOUT: ' + result)

@@ -98,4 +98,4 @@ })

mkdir(path: string): Promise<string>
exec(command: string, parameters: Array<string>, options: { cwd?: string, stdin?: string, stream?: 'stdout' | 'stderr', 'both' } = {}): Promise<Object | string>
execCommand(command: string, options: { cwd: string, stdin: string } = {}): Promise<{ stdout: string, stderr: string, signal: ?string, code: number }>
exec(command: string, parameters: Array<string>, options: { cwd?: string, options?: Object, stdin?: string, stream?: 'stdout' | 'stderr', 'both' } = {}): Promise<Object | string>
execCommand(command: string, options: { cwd: string, stdin: string } = {}): Promise<{ stdout: string, options?: Object, stderr: string, signal: ?string, code: number }>
putFile(localFile: string, remoteFile: string, sftp: ?Object = null, opts: ?Object = null): Promise<void>

@@ -102,0 +102,0 @@ getFile(localFile: string, remoteFile: string, sftp: ?Object = null, opts: ?Object = null): Promise<void>

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