
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
ftp-deploy
Advanced tools
Ftp a folder from your local disk to an ftp destination. Does not delete from destination directory. Derived from grunt-ftp-deploy
Ftp a folder from your local disk to a remote ftp destination. Does not delete from destination directory. Derived from https://github.com/zonak/grunt-ftp-deploy.
A Node.js package.
The most basic usage (stops uploading when an error occurs):
var FtpDeploy = require('ftp-deploy');
var ftpDeploy = new FtpDeploy();
var config = {
username: "username",
password: "password",
host: "ftp.someserver.com",
port: 21,
localRoot: __dirname + "/local-folder",
remoteRoot: "/public_html/remote-folder/",
exclude: ['.git', '.idea', 'tmp/*']
}
ftpDeploy.deploy(config, function(err) {
if (err) console.log(err)
else console.log('finished');
});
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(data) {
console.log(data); // same data as uploading event
});
To continue uploading files even if a file upload fails:
config.continueOnError = true;
ftpDeploy.deploy(config, function(err) {
if (err) console.log(err) // error authenticating or creating/traversing directory
else console.log('finished');
});
ftpDeploy.on('upload-error', function (data) {
console.log(data.err); // data will also include filename, relativePath, and other goodies
});
0.6.x
continueOnError
config. When set to true, ftp-deploy continues to upload files after a failed put. When not specified or set to false, the .deploy()
callback is called immediately after a failed put.upload-error
eventstopOnError
config setting in preference of continueOnError
0.5.x
stopOnError
to configuration.error
event.0.4.x
0.3.x
exclude
can be used to exclude folders/files from the ftp deploy process0.2.x
paralleluploads
: sets number of parallelUploads (within a specific folder)transferred
and total
. Useful for determining progress based on file count.npm install ftp-deploy
MIT
0.6.0
continueOnError
config. When set to true, ftp-deploy continues to upload files after a failed put. When not specified or set to false, the .deploy()
callback is called immediately after a failed put.
upload-error
eventstopOnError
config setting in preference of continueOnError
FAQs
Ftp a folder from your local disk to an ftp destination
The npm package ftp-deploy receives a total of 5,245 weekly downloads. As such, ftp-deploy popularity was classified as popular.
We found that ftp-deploy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.