Socket
Book a DemoInstallSign in
Socket

ruhnn-sftp-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruhnn-sftp-cli

封装ssh2提供的接口,提供命令行工具

0.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

ruhnn-sftp-cli

  • 介绍
  • 命令行
  • Node接口

介绍

封装ssh2提供的sftp相关接口,使用命令行上传文件。

安装方式

npm i ruhnn-sftp-cli -g

命令行

sftp-cli

Node接口

Sftp()

封装ssh2提供的sftp相关接口

Sftp.prototype.connect(option) -> Promise

连接sftp服务器

{
    "host": "sftp服务器地址",
    "port": "端口",
    "username": "用户",
    "password": "密码"
}

Sftp.prototype.exist(path) -> Promise

是否存在文件或目录

  • path:路径

Sftp.prototype.getFile(localPath, remotePath, option) -> Promise

是否存在文件或目录

  • localPath: 远端文件路径
  • localPath: 存放文件路径
  • option: fastGet配置参数 参考 ssh2-streams

Sftp.prototype.upload(pattern, remote, options, putOption) -> Promise

上传文件夹

  • pattern: glob表达式
  • remote: 远端目录
  • options: glob配置参数
  • putOption: fastPut配置参数 参考 ssh2-streams

Sftp.prototype.put(localPath, remotePath, option) -> Promise

上传文件

  • localPath: 本地文件路径
  • remotePath: 远端存放路径
  • option: fastPut配置参数 参考 ssh2-streams

Sftp.prototype.mkdir(path) -> Promise

创建目录

  • path:目录

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.