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

ftp-deploy

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ftp-deploy - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

25

ftp-deploy.js

@@ -32,3 +32,4 @@ var fs = require('fs');

var authVals;
var stopOnError = true;
function canIncludeFile(filePath) {

@@ -141,2 +142,21 @@ if (exclude.length > 0) {

var fullPathName = path.join(localRoot, currPath, inFilename);
ftp.put(fullPathName, inFilename.replace(/\\/g, '/'), function (err) {
if (err) {
if (stopOnError) {
cb(err);
} else {
emitData.err = err;
thisDeployer.emit('error', emitData);
cb();
}
} else {
thisDeployer.transferred++;
emitData.transferredFileCount = thisDeployer.transferred;
thisDeployer.emit('uploaded', emitData);
cb();
}
});
/*
fs.readFile(fullPathName, function (err, fileData) {

@@ -160,2 +180,3 @@ if (err) {

});
*/
}

@@ -194,3 +215,3 @@

remoteRoot = config.remoteRoot;
parallelUploads = config.parallelUploads || parallelUploads;
stopOnError = config.stopOnError || stopOnError;
exclude = config.exclude || exclude;

@@ -197,0 +218,0 @@

4

package.json
{
"name": "ftp-deploy",
"version": "0.4.1",
"version": "0.5.0",
"author": "Rick Bergfalk <rick.bergfalk@gmail.com> (http://rickbergfalk.com/)",

@@ -11,3 +11,3 @@ "description": "Ftp a folder from your local disk to an ftp destination. Does not delete from destination directory. Derived from grunt-ftp-deploy",

"dependencies": {
"jsftp": "0.6.x",
"jsftp": "1.2.x",
"async": "0.2.x",

@@ -14,0 +14,0 @@ "minimatch": "0.2.12"

@@ -10,2 +10,4 @@ # ftp-deploy

The most basic usage (stops uploading when an error occurs):
```js

@@ -22,3 +24,2 @@ var FtpDeploy = require('ftp-deploy');

remoteRoot: "/public_html/remote-folder/",
parallelUploads: 10,
exclude: ['.git', '.idea', 'tmp/*']

@@ -31,4 +32,7 @@ }

});
```
// to be notified of what ftpDeploy is doing
To be notified of what ftpDeploy is doing:
```
ftpDeploy.on('uploading', function(data) {

@@ -46,5 +50,26 @@ data.totalFileCount; // total file count being transferred

To continue uploading files even if a file upload fails:
```
config.stopOnError = false;
ftpDeploy.deploy(config, function(err) {
if (err) console.log(err)
else console.log('finished');
});
ftpDeploy.on('error', function (data) {
console.log(data.err); // data will also include filename, relativePath, and other goodies
});
```
## Changes
- 0.5.x
- upgraded jsftp from 0.6.x to 1.2.x
- Added stopOnError to configuration. Defaults to true. Stops uploading files if an error occurs. If set to false, ftp-deploy skips over failed file uploads and does not pass the deploy callback with an error. (Note: failing to create a directory will still stop deployment)
- added 'error' events.
- deprecated paralleluploads config setting (no longer supported by jsftp)
- 0.4.x

@@ -51,0 +76,0 @@ - uploading and uploaded events emit data instead of a relative file path.

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