
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
FTP client for Windows, OSX and Linux. FTPimp is an (imp)roved implementation of the FTP service API for NodeJS.
FTP client for Windows and OSX / Linux.
FTPimp is an (imp)roved implementation of the FTP service API for NodeJS. It has unique features that you'd otherwise expect an FTP client to have...
Only one real breaking change for anyone using ftpimp < 3.0, data returned is now a Buffer. This may affect methods that try to perform special String methods on a Buffer object (ie String.prototype.split)
FTPimp has several major benefits in comparison to other Node FTP clients:
Documentation for ftp-imp can be found at the website ¬https://sparkida.github.io/ftpimp
Tests provide an example for every (practical) endpoint in the library ¬see those here.
By default, every call is sequential. To have more granular control, use the Queue.RunLevels
You'll likely only need to use "Queue.RunNext" to prioritize a command over any subsequent commands. In the example below (#1), the sequence is [mkdir, ls, put]
example #1:
//make a "foo" directory
ftp.mkdir('foo', function (err, dir) { //runs first
ftp.put(['bar.txt', 'foo/bar.txt'], function (err, filename) { //runs third
});
});
ftp.ls('foo', function (err, filelist) { //runs second
...
});
While in the next example below(#2) we use Queue.RunNext to prioritize our "put", over that of the "ls", making our sequence [mkdir, put, ls]
example #2:
+var Queue = FTP.Queue;
//make a "foo" directory
ftp.mkdir('foo', function (err, dir) { //runs first
ftp.put(['bar.txt', 'foo/bar.txt'], function (err, filename) { //runs second
- });
+ }, Queue.RunNext);
});
ftp.ls('foo', function (err, filelist) { //runs third
...
});
Default config
var config = {
host: 'localhost',
port: 21,
user: 'root',
pass: '',
debug: false
};
Automatically login to FTP and run callback when ready
var FTP = require('ftpimp'),
ftp = FTP.create(config),
connected = function () {
console.log('connected to remote FTP server');
};
ftp.once('ready', connected);
Setup FTPimp and login whenever
var FTP = require('ftpimp'),
ftp = FTP.create(config, false);
//do some stuff...
ftp.connect(function () {
console.log('Ftp connected');
});
Put file to remote server
ftp.put(['path/to/localfile', 'remotepath'], function (err, filename) {
console.log(err, filename);
});
Get file from remote server
ftp.save(['path/to/remotefile', 'path/to/local/savefile'], function (err, filename) {
console.log(err, filename);
});
Recursively create directories.
ftp.mkdir('foo/deep/directory', function (err, created) {
console.log(err, created);
}, true);
Recursively delete directories and their contents
ftp.rmdir('foo', function (err, deleted) {
console.log(err, deleted);
}, true);
List remote directory contents
ftp.ls('foo', function (err, filelist) {
console.log(err, filelist);
});
By default, FTPimp uses passive connections for security purposes, but you can override anything you want pretty quickly to build a very robust FTP application.
Please let me know so that I can fix it ASAP, cheers ¬Report a Bug
binary
and ascii(default)
ls
lsnames
etc...FAQs
FTP client for Windows, OSX and Linux. FTPimp is an (imp)roved implementation of the FTP service API for NodeJS.
We found that ftpimp 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.