Socket
Socket
Sign inDemoInstall

ftpsync

Package Overview
Dependencies
25
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.10 to 0.2.0

41

lib/ftpsync.js

@@ -16,2 +16,3 @@ // Design Notes

var minimatch = require("minimatch");
var util = require('util');
var config = {};

@@ -160,3 +161,4 @@ if (fs.existsSync(process.cwd() + '/config.json')) {

var rFile = sync.remote.files[rIDX];
if (helpers.isDifferent(sync.local.files[lIDX], sync.remote.files[rIDX])) {
if (helpers.isDifferent(sync.local.files[lIDX], sync.remote.files[rIDX]) ||
helpers.isModified(sync.local.files[lIDX], sync.remote.files[rIDX])) {
sync.update.push(file);

@@ -231,3 +233,5 @@ }

function(callback) {
if (sync.add.length === 0) { callback(null, 'no additions'); return; }
if (sync.add.length === 0) {
callback(null, 'no additions'); return;
}
async.mapLimit(sync.add, settings.connections, utils.upload, function (err) {

@@ -244,3 +248,5 @@ if (err) {

function(callback) {
if (sync.update.length === 0) { callback(null, 'no updates'); return; }
if (sync.update.length === 0) {
callback(null, 'no updates'); return;
}
async.mapLimit(sync.update, settings.connections, utils.upload, function (err) {

@@ -467,8 +473,2 @@ if (err) {

upload: function(file, callback) {
/*var ftp = new jsftp({
host: settings.host,
port: settings.port,
user: settings.user,
pass: settings.pass
});*/
var local = settings.local + file;

@@ -484,3 +484,3 @@ var remote = settings.remote + file;

}
callback();
callback(null, file);
});

@@ -499,3 +499,3 @@ },

}
callback();
callback(null, file);
});

@@ -522,5 +522,2 @@ }

var rtimeOffset = (rtimeMM - ltimeMM) / coeff;
console.log('Offsets:');
console.log('loffset: +' + ltimeOffset);
console.log('roffset: +' + rtimeOffset);
},

@@ -553,11 +550,9 @@

// round to the nearest minute
//var minutes = 1000 * 60;
//var hours = 1000 * 60 * 60;
//var ltime = new Date(((Math.round(ltime / minutes) * minutes) - (ltimeOffset * hours)));
//var rtime = new Date(((Math.round(rtime / minutes) * minutes) - (rtimeOffset * hours)));
//var ltime = new Date(Math.round(ltime / minutes) * minutes);
//var rtime = new Date(Math.round(rtime / minutes) * minutes);
//console.log('Compare:');
//console.log('lTime: ' + ltime);
//console.log('rTime: ' + rtime);
var minutes = 1000 * 60;
var hours = 1000 * 60 * 60;
var ltime = lfile.time;
var rtime = rfile.time;
ltime = new Date((Math.round(ltime.getTime() / minutes) * minutes));
rtime = new Date((Math.round(rtime.getTime() / minutes) * minutes));
return (ltime !== rtime);
},

@@ -564,0 +559,0 @@

{
"name": "ftpsync",
"version": "0.1.10",
"version": "0.2.0",
"description": "Intelligent file syncronization over FTP",

@@ -35,3 +35,3 @@ "keywords": [

"commander": "^2.9.0",
"jsftp": "1.1.1",
"jsftp": "1.5.5",
"minimatch": "^3.0.0",

@@ -38,0 +38,0 @@ "touch": "^1.0.0"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc