npm.io
1.0.6 • Published 4 years ago

sftp-j

Licence
ISC
Version
1.0.6
Deps
1
Size
2 kB
Vulns
0
Weekly
0

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);
})();

Keywords