Comparing version 0.2.1 to 0.2.2
@@ -20,6 +20,6 @@ /* | ||
var FTPCredentials = { | ||
host: "", | ||
user: "", | ||
host: "sergimansilla.com", | ||
user: "fjakobs", | ||
port: 21, | ||
pass: "" | ||
pass: "lecatoc" | ||
}; | ||
@@ -26,0 +26,0 @@ |
51
jsftp.js
@@ -8,12 +8,7 @@ /* | ||
"use strict"; | ||
var S; | ||
var Net = require("net"); | ||
var ftpPasv = require("./lib/ftpPasv"); | ||
var Parser = require('./lib/ftpParser'); | ||
var S = require("streamer"); | ||
try { S = require("streamer"); } | ||
catch (e) { S = require("./support/streamer/core"); } | ||
var slice = Array.prototype.slice; | ||
@@ -75,2 +70,3 @@ | ||
var Ftp = module.exports = function(cfg) { | ||
"use strict"; | ||
this.raw = {}; | ||
@@ -178,3 +174,3 @@ this.options = cfg; | ||
self.connecting = false; | ||
!err && send(); | ||
send(); | ||
}; | ||
@@ -249,3 +245,3 @@ | ||
(function() { | ||
"use strict"; | ||
this.addCmdListener = function(listener) { | ||
@@ -558,3 +554,3 @@ if (this.cmdListeners.indexOf(listener) === -1) | ||
cmd: "retr " + filePath, | ||
pasvCallback: callback, | ||
pasvCallback: callback | ||
}); | ||
@@ -570,3 +566,4 @@ }; | ||
var socket = self.dataConn.socket; | ||
socket.writable && socket.end(buffer); | ||
if (socket.writable) | ||
socket.end(buffer); | ||
}, | ||
@@ -605,2 +602,20 @@ pasvCallback: callback | ||
this.ls = function(filePath, callback) { | ||
var entriesToList = function(err, entries) { | ||
if (err) | ||
return callback(err, entries); | ||
if (!entries) | ||
return callback(null, []); | ||
callback(null, | ||
(entries.text || entries) | ||
.split(/\r\n|\n/) | ||
.map(function(entry) { | ||
return Parser.entryParser(entry.replace("\n", "")); | ||
}) | ||
// Flatten the array | ||
.filter(function(value){ return !!value; }) | ||
); | ||
}; | ||
if (this.useList) { | ||
@@ -630,19 +645,3 @@ this.list(filePath, entriesToList); | ||
function entriesToList(err, entries) { | ||
if (err) | ||
return callback(err, entries); | ||
if (!entries) | ||
return callback(null, []); | ||
callback(null, | ||
(entries.text || entries) | ||
.split(/\r\n|\n/) | ||
.map(function(entry) { | ||
return Parser.entryParser(entry.replace("\n", "")); | ||
}) | ||
// Flatten the array | ||
.filter(function(value){ return !!value; }) | ||
); | ||
} | ||
}; | ||
@@ -649,0 +648,0 @@ |
@@ -44,4 +44,2 @@ /* | ||
var unixEntries = [ | ||
@@ -48,0 +46,0 @@ { |
@@ -10,3 +10,2 @@ /** | ||
"use strict"; | ||
var RE_SERVER_RESPONSE = /^(\d\d\d)(.*)/; | ||
@@ -216,3 +215,2 @@ var RE_MULTI_RESPONSE = /^(\d\d\d)-/; | ||
var time = group[2].replace(/(\d{2}):(\d{2})([AP]M)/, replacer); | ||
var date = new Date(group[1] + " " + time).getTime(); | ||
@@ -219,0 +217,0 @@ var dirString = group[3]; |
@@ -8,4 +8,2 @@ /* | ||
"use strict"; | ||
var Net = require("net"); | ||
@@ -17,2 +15,3 @@ var S; | ||
module.exports = function(cfg) { | ||
"use strict"; | ||
var data; | ||
@@ -19,0 +18,0 @@ var callback = cfg.callback; |
{ | ||
"name": "jsftp", | ||
"id": "jsftp", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "A sane FTP client implementation for NodeJS", | ||
"keywords": [ "ftp", "streams", "files", "server", "client", "async" ], | ||
"author": "Sergi Mansilla <sergi.mansilla@gmail.com>", | ||
"author": "Sergi Mansilla <sergi.mansilla@gmail.com> (http://www.sergimansilla.com)", | ||
"homepage": "https://github.com/sergi/jsftp", | ||
@@ -14,3 +14,3 @@ "repository": { | ||
"bugs": { | ||
"web": "https://github.com/sergi/jsftp/issues" | ||
"url": "https://github.com/sergi/jsftp/issues" | ||
}, | ||
@@ -25,3 +25,3 @@ "dependencies": { | ||
"engines": { | ||
"node": ">=0.4.x" | ||
"node": ">=0.4" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
1
2
212180
25
1684