node-deploy-self
v1.0.1
Published
前端上传打包代码至服务器
Downloads
8
Readme
Description
用于帮助前端开发直接部署项目至服务器。
Installation
npm i node-deploy-self
Usage :
例子🌰
const Deploy = require('node-deploy-self')
const server = new Deploy({
projectName:'用户端',
name: '开发',
script: 'npm run build', // 打包命令
host: '192.168.8.888', // 服务器地址
port: 88, // 服务器端口号
username: 'root', // 服务器登录用户名
password: '123456', // 服务器登录密码
distPath: 'build', // 本地打包生成目录
webDir: '/usr/local/nginx/html/test', // 服务器部署路径(不可为空或'/')
})
server.deploy()
参数说明
| 参数 | 描述 | 类型 | | ---- | ---- | ---- | | projectName | 项目名字 | String 非必填 | | name | 项目环境 | String 非必填 | | script | 打包命令 | String 必填,默认 npm run build | | host | 服务器地址 | String 必填 | | port | 服务器端口号 | Number 必填 | | username | 服务器登录用户名 | String 必填 | | password | 服务器登录密码 | String 必填 | | distPath | 本地打包生成目录 | String 必填 | | webDir | 服务器部署路径 | String 必填 |