Created
April 19, 2018 09:20
-
-
Save tuttelikz/57102e771875a8d25b4f0c16dd403be0 to your computer and use it in GitHub Desktop.
Simple script to test library: https://github.com/sergi/jsftp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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