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

scp2

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scp2 - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

18

lib/client.js

@@ -97,2 +97,3 @@ var fs = require('fs');

};
Client.prototype.close = function() {

@@ -109,2 +110,3 @@ if (this.__sftp) {

Client.prototype.mkdir = function(dir, attrs, callback) {

@@ -115,4 +117,5 @@ if (_.isFunction(attrs)) {

}
if (attrs) {
attrs.mode = attrs.mode || '0755';
attrs.mode = getFolderAttr(process.platform, attrs);
}

@@ -309,5 +312,16 @@

if (process.platform === 'win32') {
filepath = filepath.replace(/\\/g, '/');
return filepath.replace(/\\/g, '/');
}
return filepath;
}
function getFolderAttr(platform, attrs) {
var DEFAULT_MODE = '0755';
if (platform === 'win32') {
return DEFAULT_MODE;
}
if (attrs) {
return attrs.mode || DEFAULT_MODE;
}
}

12

lib/scp.js

@@ -84,3 +84,6 @@ var fs = require('fs');

}
client.download(remote.path, dest, callback);
client.download(remote.path, dest, function () {
client.close();
callback.apply(this, arguments);
});
}

@@ -92,4 +95,7 @@

exports.scp = function(src, dest, callback) {
var client = new Client();
exports.scp = function(src, dest, client, callback) {
if (typeof client === 'function') {
callback = client;
client = new Client();
}
client.on('error', callback);

@@ -96,0 +102,0 @@ var parsed = client.parse(src);

{
"name": "scp2",
"version": "0.2.2",
"version": "0.3.0",
"description": "A pure javascript scp program based on ssh2.",

@@ -15,3 +15,3 @@ "author": "Hsiaoming Yang <lepture@me.com>",

"dependencies": {
"ssh2": "~0.3.6",
"ssh2": "~0.4.10",
"glob": "~4.0.6",

@@ -18,0 +18,0 @@ "async": "~0.9.0",

@@ -118,3 +118,4 @@ # scp2

username: 'admin',
privateKey: '....'
privateKey: '....',
// password: 'password', (accepts password also)
});

@@ -193,2 +194,12 @@ ```

**2016-04-18** `0.3.0`
* Retain compatible with old implementations
* Added parameter to scp to allow custom client
* Add password to client object options
* Fix scp from windows client with folder
* Update version of ssh2 to 0.4.10
* Add pass arguments to callback
* Fix Closes conection when downloading a single file
**2015-06-01** `0.2.2`

@@ -195,0 +206,0 @@

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