scp
v0.0.3
Published
remote file copy wrapper
Downloads
7,832
Readme
node-scp
SCP (secure file copy) wrapper for node.js
##install
npm install scp
##usage
var scp = require('scp');
var options = {
file: 'dump.sql'
host: 'myServer',
path: '~'
}
scp.send(options, function (err) {
if (err) console.log(err);
else console.log('File transferred.');
});
##methods
###scp.send(options, cb)
Send a file to a remote host (in your ~/.ssh/config
)
You must pass in options
. A cb
function is optional, and will be passed err
, stdout
, and stderr
.
There are currently 3 options:
scp.send({
file: './file.txt', // local file to send
host: 'myServer', // remote host to copy to, set up in your ~/.ssh/config
path: '~' // remote path to save to (this would result in a ~/file.txt on myServer)
});
###scp.get(options, cb)
Transfer a file from a remote host (in your ~/.ssh/config
) to the current computer.
You must pass in options
. A cb
function is optional, and will be passed err
, stdout
, and stderr
.
There are currently 3 options:
scp.get({
file: '~/file.txt', // remote file to grab
host: 'myServer', // remote host to transfer from, set up in your ~/.ssh/config
path: '~' // local path to save to (this would result in a ~/file.txt on the local machine)
});
license
(The MIT License)
Copyright (c) 2011 Cam Pedersen [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.