simple-ssh
Advanced tools
Comparing version 0.8.7 to 0.8.8
@@ -123,2 +123,3 @@ 'use strict'; | ||
}); | ||
if (command.in) stream.end(command.in); | ||
}); | ||
@@ -142,2 +143,3 @@ }; | ||
start: function(){}, | ||
in: null, | ||
out: function(){}, | ||
@@ -156,2 +158,3 @@ err: function(){}, | ||
cmd: command, | ||
in: options.in, | ||
handlers: { | ||
@@ -158,0 +161,0 @@ start: options.start, |
{ | ||
"name": "simple-ssh", | ||
"version": "0.8.7", | ||
"version": "0.8.8", | ||
"description": "A wrapper for ssh2 to make it easier to perform commands over SSH", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -72,2 +72,10 @@ # simple-ssh | ||
* Sending data to stdin: | ||
```javascript | ||
ssh.exec('cat > /path/to/remote/file', { | ||
in: fs.readFileSync('/path/to/local/file') | ||
}).start(); | ||
``` | ||
* Chaining commands together: | ||
@@ -180,2 +188,3 @@ | ||
* **options.args** { _String[]_ }: Additional command line arguments (default: `null`) | ||
* **options.in** { _String_ }: Input to be sent to `stdin` | ||
* **options.out** { _Function( stdout )_ }: `stdout` handler | ||
@@ -182,0 +191,0 @@ * **stdout** { _String_ }: Output streamed through `stdout` |
@@ -103,2 +103,13 @@ 'use strict'; | ||
}); | ||
it('should provide data on stdin', function(done) { | ||
var input = 'The quick brown fox\njumps over the lazy dog.\n'; | ||
ssh.exec('cat', { | ||
in: input, | ||
out: function(stdout) { | ||
expect(stdout).to.be(input); | ||
done(); | ||
} | ||
}).start(); | ||
}); | ||
@@ -105,0 +116,0 @@ it('should handle multiple commands', function(done) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28460
10
559
264