1.0.6 • Published 3 years ago
sftp-j v1.0.6
Installation
$ npm i sftp-j
Basic Usage
const SftpTool = require("sftp-j");
const sftp = new SftpTool({
host: "your server ip address",
port: "",
username: "root",
password: "******",
});
//download file
(async () => {
//local file remote file
let res = await sftp.downloadFile("./1.txt", "/root/test/1.txt");
console.log(res);
})();
//uploadFile file
(async () => {
let res = await sftp.uploadFile("./1.txt", "/root/test/1.txt");
console.log(res);
})();