Huge News!Announcing our $40M Series B led by Abstract Ventures.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.3.1 to 0.4.0

16

ftp-deploy.js

@@ -129,6 +129,15 @@ var fs = require('fs');

function ftpPut(inFilename, cb) {
thisDeployer.emit('uploading', path.join(currPath, inFilename));
var emitData = {
totalFileCount: thisDeployer.total,
transferredFileCount: thisDeployer.transferred,
percentComplete: Math.round((thisDeployer.transferred / thisDeployer.total) * 100),
filename: inFilename,
relativePath: currPath
};
thisDeployer.emit('uploading', emitData);
var fullPathName = path.join(localRoot, currPath, inFilename);
fs.readFile(fullPathName, function (err, fileData) {
if (err) {
if (err) {
cb(err);

@@ -143,3 +152,4 @@ } else {

thisDeployer.transferred++;
thisDeployer.emit('uploaded', path.join(currPath, inFilename));
emitData.transferredFileCount = thisDeployer.transferred;
thisDeployer.emit('uploaded', emitData);
cb();

@@ -146,0 +156,0 @@ }

2

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

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

@@ -30,11 +30,12 @@ # ftp-deploy

// if you want to be notified of what ftpDeploy is doing
// listen to some of the events it's emitting
// Want more events? Let me know and I'll add them.
ftpDeploy.on('uploading', function(relativeFilePath) {
console.log('uploading ' + relativeFilePath);
// to be notified of what ftpDeploy is doing
ftpDeploy.on('uploading', function(data) {
data.totalFileCount; // total file count being transferred
data.transferredFileCount; // number of files transferred
data.percentComplete; // percent as a number 1 - 100
data.filename; // filename being uploaded
data.relativePath; // relative path to file being uploaded from local root location
});
ftpDeploy.on('uploaded', function(relativeFilePath) {
var percentTransferred = Math.round((ftpDeploy.transferred/ftpDeploy.total) * 100);
console.log(percentTransferred + '% uploaded ' + relativeFilePath);
ftpDeploy.on('uploaded', function(data) {
console.log(data); // same data as uploading event
});

@@ -46,2 +47,5 @@ ```

- 0.4.x
- uploading and uploaded events emit data instead of a relative file path.
- 0.3.x

@@ -48,0 +52,0 @@ - New config setting **exclude** can be used to exclude folders/files from the ftp deploy process

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