1.0.5 • Published 3 years ago
sftp-connection v1.0.5
sftp-connection
Installation
npm i -D sftp-connection
Usage
- upload files to remote server
const SftpConnection = require('sftp-connection');
const { readFileSync } = require('fs');
const sftp = new SftpConnection({
host: '127.0.0.1',
port: 22,
username: 'root',
password: 'password' // or privateKey: readFileSync('/xx/xxx/.ssh/id_rsa')
});
sftp.upload({
localPathPrefix: '/root/project/',
localPath: '/root/project/**/*', // glob rules
remotePath: '/usr/nginx/html/project/
});