Git Product home page Git Product logo

ssh-sftp's Introduction

ssh-sftp

简单易用的 SFTP 工具,可以上传/忽略/删除远程的文件

安装

# 全局
npm i ssh-sftp -g

# 局部
npm i ssh-sftp -D

使用

  1. 首先初始化一份配置文件

npx ssh-sftp init

  1. 将生成的.sftprc.json文件里的信息填写完整

  2. 添加脚本到 package.json

{
  "scripts": {
    "deploy": "ssh-sftp",
    "ls-deploy-files": "ssh-sftp ls"
  }
}

建议在部署前使用npx ssh-sftp ls查看哪些文件会被上传或删除

字段说明

.sftprc.json

字段名 类型 描述
localPath string
remotePath string
connectOptions ConnectOptions 登录信息
ignore string[] 忽略localPath中的部分文件,glob类型
cleanRemoteFiles boolean | string[] 清空远程文件夹,或按glob匹配清空远程部分文件
securityLock boolean 安全锁,默认开启
keepAlive boolean 保持连接
noWarn boolean 禁止提示

connectOptions

字段名 类型 描述
host string
port number
username string
password string

securityLock

安全锁 默认开启,会校验项目名称与远程地址是否匹配防止误传,关闭后忽略验证

Commands

ssh-sftp init

初始化生成配置文件 .sftprc.json

ssh-sftp ls

列出所有需要上传/删除/忽略的文件

ssh-sftp ls -u 单独列出所有需要上传的文件

ssh-sftp ls -d 单独列出所有需要删除的文件

ssh-sftp ls -i 单独列出所有忽略的文件

ssh-sftp's People

Contributors

ironkinoko avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.