xm-post-ftp

使用ftp或sftp指定文件上传模块

Usage no npm install needed!

<script type="module">
  import xmPostFtp from 'https://cdn.skypack.dev/xm-post-ftp';
</script>

README

说明

ftp/sftp配置

/cfg/autoftpconfig.js配置:

module.exports = {
  "host": "115.28.187.30",
  "user": "shanghaitao",
  "password": "shanghaitao",
  "remoteSource": "/data1/node/frontend_car_service_13353"
};

命令模式

npm run postftp sftp /page/bundle

接口模式

var postftp = require('xm-post-ftp');
postftp({
  path: '/page/bundle',
  mode: 'sftp'
}, function() {
  console.log('POST END');
});