node-ftps-promise
Fork of node-ftps using available ES6 in node 4.2.1 and Promises
FTP, FTPS and SFTP client for node.js, mainly a lftp
wrapper.
Requirements
You need to have the executable lftp
installed on your computer.
Installation
npm install ftps
Usage
var FTPS = ;var ftps =;// Do some amazing thingsftps;
Some documentation
Here are some of the chainable functions :
ftpsftpsftpsftpsftps // alias: addFileftps // download remote file and save to local path (if not given, use same name as remote file), alias: getFileftps // alias moveftps // alias removeftps
If you want to escape some arguments because you used "escape: false" in the options:
ftps;// Return 'My\\ \\$folder'
Execute a command on the remote server:
ftps
To see all available commands: LFTP Commands
For information, ls, pwd, ... rm are just some alias of raw() method.
Run the commands
ftps;// exec() return a promise
Also, take note that if a command fails it will not stop the next commands from executing, for example:
ftps;/*Will add file on ~/ and give:{error: 'cd: non-existing-dir: No such file or directory\n',data: ''}So...be cautious because ./test.txt has been added*/
Why?
Because I wantded to be able to compose it with promises and wanted methods to be first-class, so avoid the hassle of prototype.