README
简介
easy-deploy-ftp 是一个基于 node.js 的方便、快捷的 FTP 工具.
要求
- node.js -- 版本高于v0.11.15
安装
npm i -D easy-deploy-ftp
生成配置文件
node_module/easy-deploy-ftp/bin/cli.js --init
例子
- easyftp.config.js
module.exports = {
entry: 'dist',
remoteEntry: '.',
host: localhost,
port: 21,
username: 'test',
password: 'test',
remote: [
{
pattern: '*.html',
path: '.',
},
{
pattern: 'css/*',
path: 'css',
},
]
}
- 同步dist目录的所有html文件到远程主机的根目录
- 同步dist/css目录的所有文件到远程主机的css目录
配置
entry - string 目录 默认: 'dist'
host - string ftp主机名或IP 地址 默认: 'localhost'
port - number 端口号 默认: 21
username - string 用户名
password - string 密码
remote - array 从本地上传到远程主机
remote.pattern - string 参考 https://www.npmjs.com/package/glob
remote.path - string 远程主机路径
CLI API
- --init - 快速生成easyftp.config.js模板文件
- --deploy - 开始部署
- --config - 指定配置文件路径;
发布历史
v0.0.4-beta
- 安装后自动在当前目录生成配置文件(easyftp.config.js)
- 修复在window平台上同步文件的路径问题