I am noob in Node.js. I try to download all files from directory using PromiseFtp
But I have a problem. I don't know how to begin downloading files. I make next:
var ftp = new PromiseFtp();
ftp.connect({host: '------', user: '----------', password: '------------'})
.then(function (serverMessage) {
console.log('Server message: '+serverMessage);
return ftp.list('/');
}).then(function (list) {
list.forEach(function (element, index, array) {
if (element.name !== '..' && element.name !== '.'){
console.log(element.name)
}
})
}).then(function () {
return ftp.end();
});
Now I have list of files. But I don't know what I must do. After downloading I must delete all files from ftp.
Please. Help me