sftpcopy

1.0.0 • Public • Published

实现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()
 
 
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i sftpcopy

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

3.25 kB

Total Files

4

Last publish

Collaborators

  • cygdream