Skip to content

Commit

Permalink
update readme: upload multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
maitrungduc1410 committed Sep 18, 2020
1 parent 31989ff commit 8da7502
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@ const scp = require('node-scp')

async function test() {
try {
const c = await scp({
const client = await scp({
host: 'your host',
port: 22,
username: 'username',
password: 'password',
// privateKey: fs.readFileSync('./key.pem'),
// passphrase: 'your key passphrase',
})
await c.uploadFile('./test.txt', '/workspace/test.txt')
c.close() // remember to close connection after you finish
await client.uploadFile('./test.txt', '/workspace/test.txt')
// you can perform upload multiple times
await client.uploadFile('./test1.txt', '/workspace/test1.txt')
client.close() // remember to close connection after you finish
} catch (e) {
console.log(e)
}
Expand Down

0 comments on commit 8da7502

Please sign in to comment.