3.1.7 • Published 5 months ago
comlog-ftp v3.1.7
comlog-ftp

FTP Client with encoding support
Installation
$ npm install --save comlog-ftp
Usage Simple way
const FTP = require('../dist/client').Client;
(async function() {
var conn = new Client();
await conn.connectAsync(21, "localhost");
console.info('connected!');
await conn.login('anonymous', 'anonymous@')
console.info('logged in!');
await conn.pasv();
var res = await conn.list();
console.info(res);
await conn.quit();
})();
Usage Adwanced way
const FTP = require('../dist/client').Client;
(async function() {
var conn = new Client();
await conn.connectAsync(21, "localhost");
conn.on('error', function(err) {
console.error(err);
});
// Optional custom data handling
conn.on('data', function(data) {
// custom socket data handling
});
// Optional custom code 220 handling (all ftp codes can be used)
this.on('220', function (chunk) {
this.write('USER ' + this.user, function(){});
});
conn.get('/some_filename.txt', 'c:\\some_filename.txt')
.then(function() {
console.info('Download Success!');
})
.catch(function (err) {
console.error(err);
})
;
// OR
conn.raw('ALLO')
.then(function(response) {
console.info(response);
})
.catch(function (err) {
console.error(err);
})
;
await conn.quit();
})();
Functions
- connect( callback ) void
- write( command, callback ) void
- raw( command, args, callback ) void
- feat( callback ) void
- list( callback ) void
- get( removeFilePath, localFilePath, callback ) void
- put( localFilePath, removeFilePath, callback ) void
- cwd( remotePath, callback ) void
- pwd( callback ) void
- rename( remoteFromPath, remoteToPath, callback) void
- delete( remoteFilePath, callback ) void
- mkdir( remotePath, callback ) void
- rmdir( remoteDir, callback ) void
- stat( callback ) void
- destroy() void
Properties
- {int} port Default: 21
- {String} host Default: "localhost"
- {boolean} active Default: true
- {int} timeout Default: 10 60 1000
- {String} type Default: 'I'
- {boolean} debug Default: false
CHANGELOG
- New Promise based FTP Client
License
ISC © COMLOG GmbH
3.1.7
5 months ago
3.1.3
6 months ago
3.1.2
6 months ago
3.1.0
6 months ago
3.1.6
6 months ago
3.1.5
6 months ago
3.1.4
6 months ago
3.0.4
6 months ago
3.0.3
6 months ago
3.0.2
6 months ago
3.0.8
6 months ago
3.0.7
6 months ago
3.0.5
6 months ago
3.0.0
6 months ago
2.0.9
2 years ago
2.1.0
2 years ago
1.3.6
3 years ago
1.3.5
3 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.5
3 years ago
2.0.4
3 years ago
2.0.7
3 years ago
2.0.6
3 years ago
2.0.8
3 years ago
2.0.1
3 years ago
1.3.4
5 years ago
1.3.3
6 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.9
7 years ago
1.2.8
7 years ago
1.2.7
7 years ago
1.2.6
7 years ago
1.2.5
7 years ago
1.2.4
7 years ago
1.2.3
7 years ago
1.2.2
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.9
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
0.0.1
7 years ago