Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

s-sftp-upload

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s-sftp-upload

一个简单的ftp上传工具,主要用于项目部署并可选将上传的文件打包备份服务器。

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

s-sftp-upload logo

s-sftp-upload

一个简单的ftp上传工具包,创建目的主要是用于项目打包部署代码。 将指定本地目录上传到远程服务器指定目录中。 还可将本地上传目录文件打包备份到服务器上,保存每次部署的代码版本。

安装

npm install s-sftp-upload

简单示例

const path = require('path');
const ftpUpload = require('s-sftp-upload');

const ftpU = new ftpUpload({
    host: 'xx.xx.xx.xx',
    port: 22,
    username: 'root',
    password: '123456',
    localPath: path.resolve(__dirname, './dist'), // 指定需上传的本地目录
    remotePath: '/app/bus/admin', //指定服务器目录
    // 以下可选填
    isBackup: true,
    backupPath: '/app/bus/admin/backup',
})
// 开始执行上传
ftpU.start()

参数配置

OptionValueDescription
hostString必填,服务器主机地址,例:’x.x.x.x'
portNumber必填,端口,例:22 (一般默认22)
usernameString必填,服务器用户名,例:root
passwordString必填,服务器用户密码,例:123456
localPathString必填,指定本地需上传的目录,需要绝对路径,例:path.resolve(__dirname, './xxx')
remotePathString必填,指定上传到远程服务器的目录,例:'/app/bus/admin'
isBackupBoolean可选,是否需要需要打包上传备份
backupPathString可选,当isBackup=true时,可指定打包压缩后的文件上传远程服务器路径,默认为 remotePath 路径。

Keywords

FAQs

Package last updated on 30 Sep 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc