We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d20270c commit 7971cadCopy full SHA for 7971cad
scp.js
@@ -4,14 +4,31 @@
4
*/
5
var exec = require('child_process').exec;
6
7
-var scp = {};
+var scp = module.exports = {};
8
9
+/*
10
+ * Transfer a file to a remote host
11
+ */
12
scp.send = function (options, cb) {
-
13
+ exec ('scp ', function () {
14
+ cb(arguments);
15
+ });
16
}
17
18
19
+ * Grab a file from a remote host
20
21
scp.get = function (options, cb) {
22
+ var command = [
23
+ 'scp',
24
+ options.host + ':' + options.file,
25
+ options.path
26
+ ];
27
+ exec(command.join(' '), function (err, stdout, stderr) {
28
+ if (cb) {
29
+ cb(err, stdout, stderr);
30
+ } else {
31
+ if (err) throw new Error(err);
32
+ }
33
34
-module.exports = scp;
0 commit comments