# @weilinerl/deploy-helper

> 前端自动化压缩、上传、解压到目标服务器指定目录小工具

Latest version **1.0.8** (published 2025-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @weilinerl/deploy-helper
pnpm add @weilinerl/deploy-helper
yarn add @weilinerl/deploy-helper
bun add @weilinerl/deploy-helper
```

Provides the command `deploy-app`.

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2025-11-07 |
| First published | 2021-01-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | WeilinerL |
| Maintainers | weilinerl |

## Links

- npm: https://www.npmjs.com/package/@weilinerl/deploy-helper
- npm.io page: https://npm.io/package/@weilinerl/deploy-helper

## Dependencies (2)

- [ssh2](https://npm.io/package/ssh2.md) ^0.8.9
- [archiver](https://npm.io/package/archiver.md) ^5.2.0

## Recent versions

- 1.0.8 (latest) — 2025-11-07
- 1.0.7 — 2024-08-09
- 1.0.6 — 2024-08-06
- 1.0.5 — 2021-01-31
- 1.0.4 — 2021-01-31
- 1.0.3 — 2021-01-31
- 1.0.2 — 2021-01-25
- 1.0.1 — 2021-01-25
- 1.0.0 — 2021-01-25

## README

# 前端自动部署工具

> 为了解决前端开发中频繁需要将打包后的本地代码发布到个人服务器的相应目录下，以便部署webapp应用的苦恼，浓缩了这款小工具

# 使用方法

## 1. 下载相应的npm包到本地
```
npm install @weilinerl/deploy-helper -D
```

## 2. 在项目的根目录下新建/配置 **.deploy.config.json** 文件

```
{
  "host": "", // 域名或ip地址
  "port": 22, // 默认sftp连接端口号
  "localPath": "./dist", // 需要上传到服务器的本地文件夹目录
  "remotePath": "/root/dist", // 需要上传到目标服务器的文件夹目录，一般为tomcat的webapp目录
  "readyTimeout": 20000 // 默认连接超时时间
}
```

## 3. 在项目的package.json 的scripts中配置相应的启动命令

```
...
 scripts: {
   ...
   "deploy": "deploy-app"
 }
 ...
```
## 4. 开始发布

项目执行打包构建命令后会在根目录生成相应的文件夹，只需要在.deploy.config.json文件中配置好打包后的本地文件的文件夹相对目录localPath，然后执行以下命令即可

```
npm run deploy -- --username=${你的远程服务器的登录用户名} --password=${你的远程服务器的登录密码}
```

发布完成后会在服务器的remotePath文件夹中生成相应的文件（夹），
同时在本地配置的localPath文件夹中的生成相应的压缩文件（夹），文件名即为要上传的文件（夹）的文件（夹）名。

**注意！ 你的远程文件会被直接覆盖，将不会保留上一个版本，请做好备份谨慎使用！**

---
_Source: https://npm.io/package/@weilinerl/deploy-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
