Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FTP module for Node.js that can sync files? [closed]

I am looking for a module for Node.js - preferably available through npm that can sync files with an FTP server. The ftp module has all the basic functions, but writing a full blown sync system on top of it seems like a lot of work.

like image 356
mzedeler Avatar asked Dec 20 '22 20:12

mzedeler


1 Answers

I'm the author of jsftp. It should be easy to sync through it simply walking through the directories you want to upload. Jsftp can handle parallel passive requests (internally they are still sequential, but you don't have to worry about it), so you could just use sequential ftp.put calls and it should work without much scripting effort on your side.

Even better and more idiomatic in node would be to use the yet to be documented ftp.getPutSocket method, which allows you to get the raw PASV socket and just push into it (using streams, for example). For a particular example of this case, you can look at how vfs-ftp does it.

Feel free to contact me if you need more help with implementing the syncing.

like image 144
Sergi Mansilla Avatar answered Dec 24 '22 02:12

Sergi Mansilla