Giter VIP home page Giter VIP logo

auto-sftp's Introduction

Node-Sftp

工作调试需要上传到服务器上验证一些功能,用FTP工具下传下载的太麻烦了,写了个小脚本,自动上传文件,解放拉下拉下的动作了

  • 支持配置选项

  • 支持文件更新时自动上传

画起来,重要的配置文件解释,文件是config.json

const configJson = {
  // 服务器地址
  host: '192.10.11.15',
  // 服务器端口--默认端口22
  port: '22',
  // 用户名
  username: 'appadmin',
  // 是否开启文件改动时上传(默认为false)
  watch: true,
  // 密码
  password: '****',
  // 本地目录
  localPath: '/mzone/dist/web',
  // 需要上传到服务器的目录,没有默认为要目录
  remoteFilePath:'/dist'
}

上面的本地目录在window系统下注意“\”这个斜杆要这样写“/”

如何使用

  • clone 当前项目
  • 在项目根目录执行npm install
  • 填写config.js配置选项
  • 开始上传npm run start

auto-sftp's People

Watchers

James Cloos 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.