# deploy2server

> web 项目打包及部署

Latest version **1.0.3** (published 2021-03-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install deploy2server
pnpm add deploy2server
yarn add deploy2server
bun add deploy2server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-03-22 |
| First published | 2021-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | visionary |
| Maintainers | visionary_m |

## Links

- npm: https://www.npmjs.com/package/deploy2server
- npm.io page: https://npm.io/package/deploy2server

## Dependencies (5)

- [ora](https://npm.io/package/ora.md) ^5.4.0
- [ssh2](https://npm.io/package/ssh2.md) ^0.8.9
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [archiver](https://npm.io/package/archiver.md) ^5.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.1.0

## Recent versions

- 1.0.3 (latest) — 2021-03-22
- 1.0.2 — 2021-03-22
- 1.0.1 — 2021-03-22
- 1.0.0 — 2021-03-22

## README

### 安装
```
npm i deploy2server --save
```
### 使用
```
const { dir2Tar, upload2Server } = require('./index');

const config = {
	host: '',
	port: '',
	username: "",
	password: '',
	// ⚠️：windows system path different from linux
	serverBaseCodePath: '/root/wwwRoot/code/',
	serverWebPath: '/root/wwwRoot/',
	projectName: 'web-project',
	version: 'v1.0.0',
	outputPath: './',
	codePath: './build',
};
const packageCallback = () => {
	console.info('Package Succeed ！\n');

};
const uploadCallback = () => {
	console.info('Upload Succeed ！');
};
(async () => {
	await dir2Tar(config);
	packageCallback();
	await upload2Server(config);
	uploadCallback();
})();
__
```

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