mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
25 lines
377 B
TypeScript
25 lines
377 B
TypeScript
import FTP = require('ftps');
|
|
|
|
const options: FTP.FTPOptions = {
|
|
host: '',
|
|
port: 21
|
|
};
|
|
|
|
const ftp = new FTP(options);
|
|
|
|
ftp.ls().getFile('.', '.').exec((err, data) => {
|
|
if (err) {
|
|
throw err;
|
|
}
|
|
|
|
const error = data.error;
|
|
const rawData = data.data;
|
|
if (error) {
|
|
return error;
|
|
}
|
|
|
|
if (rawData) {
|
|
return rawData;
|
|
}
|
|
});
|