1.0.0 • Published 2 years ago
dr-ftp v1.0.0
1、使用说明
- (1)
const ftp = require('dr-ftp');
const path = require('path');
// 这四个参数都是字符串
const config = {
host: '10.16.100.82',
port: '22', // 默认是21,这个看自己要连接的端口
user: 'dr',
password: 'pwd'
};
// 有几个上传的位置就写几个,一般只有一个
ftp({
...config,
sourceDir: path.join(path.dirname(__dirname), 'dist/html'),
targetDir: '/apps/data/templates/flexstaff'
});
ftp({
...config,
sourceDir: path.join(path.dirname(__dirname), 'dist/flexstaff'),
targetDir: '/apps/data/templates/static/flexstaff'
});
- (2)在package.json文件scripts里面添加自己的命令 例如: "ftp": "echo \"更新全部文件夹\" && node ./ftp/config.js"
2、依赖包说明
- (1)、使用的是ssh2-sftp-client,自己写着玩儿的,最开始使用的ftp,连接没有反应解决不了。
- (2)、ora:loading效果,chalk懒得加了
1.0.0
2 years ago