Skip to content

Instantly share code, notes, and snippets.

@tuttelikz
Created April 19, 2018 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuttelikz/57102e771875a8d25b4f0c16dd403be0 to your computer and use it in GitHub Desktop.
Save tuttelikz/57102e771875a8d25b4f0c16dd403be0 to your computer and use it in GitHub Desktop.
Simple script to test library: https://github.com/sergi/jsftp
const userInfo = "sanzhar"
const passInfo = "unist"
const jsftp = require("jsftp");
const Ftp = new jsftp({
host: "mico.knu.ac.kr",
port: 22, // defaults to 21
user: userInfo, // defaults to "anonymous"
pass: passInfo // defaults to "@anonymous"
});
Ftp.ls(".", (err, res) => {
res.forEach(file => console.log(file.name));
});
Ftp.raw("quit", (err, data) => {
if (err) {
return console.error(err);
}
console.log("Bye!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment