sftpcopy
v1.0.0
Published
可以实现node连接服务器,进行文件夹拷贝
Downloads
2
Readme
实现sftp的文件夹上传服务器
使用
const {resolve}=require("path")
const localDir=resolve(__dirname,"../dist")
const sftpcopy=require("sftpcopy");
const config ={
host: '127.178.2.2',
port: '22',
username: 'root',
password: '123456',
copys:[
//文件夹上传服务器
{
type:"dir",
from:resolve(localDir,"includes"), //本地地址
to:"/data/app/wct.smart-led.club/public/includes" //服务器地址
},
// 文件上传服务器
{
type:"file",
from:resolve(localDir,"entry.html"),
to:"/data/app/wct.smart-led.club/public/entry.html"
}
]
}
async function run (){
let res=await sftpcopy(config)
console.log(res)
}
run()