sftp-j
v1.0.6
Published
上传或者下载服务器文件
Readme
Installation
$ npm i sftp-jBasic 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);
})();