Open xiaoji121 opened 10 years ago
I don't know either.
You'll get much better performance if you use sftp.fastGet() and sftp.fastPut() as they do concurrent reads/writes for you.
@mscdex A pull request is welcome
var client = new Client({ host: config.host, username: config.username, privateKey: config.privateKey, });
client.on('transfer', function (buffer, uploaded, total) { console.log(buffer, uploaded, total, new Date()); });
scp(config.localPath, { host: config.host, username: config.username, privateKey: config.privateKey, path: config.path }, client, err => { spinner.stop(); if (!err) { console.log(chalk.green("部署完毕")) } else { console.log("err", err) } })
i want to use scp method to copy a directory to the remote host,but it cost too much time to finish it. but i use scp command directly, it cost very little time , i don't know why.