Socket
Socket
Sign inDemoInstall

sftp-connection

Package Overview
Dependencies
28
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sftp-connection

sftp


Version published
Maintainers
1
Install size
4.33 MB
Created

Readme

Source

sftp-connection

npm npm NPM

Installation

npm i -D sftp-connection

Usage

  1. 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/
});

Keywords

FAQs

Last updated on 27 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc