# aliyun-oss-deploy

> An aliyun oss deploy tool, putObject and putStream are all supported.

Latest version **0.1.5** (published 2019-07-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install aliyun-oss-deploy
pnpm add aliyun-oss-deploy
yarn add aliyun-oss-deploy
bun add aliyun-oss-deploy
```

Provides the command `aliyun-oss-deploy`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-07-22 |
| First published | 2018-05-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hustcc |
| Maintainers | atool |
| Keywords | aliyun, oss, aliyun-oss, deploy, cd |

## Links

- npm: https://www.npmjs.com/package/aliyun-oss-deploy
- Repository: https://github.com/hustcc/aliyun-oss-deploy
- Homepage: https://github.com/hustcc/aliyun-oss-deploy#readme
- Issues: https://github.com/hustcc/aliyun-oss-deploy/issues
- npm.io page: https://npm.io/package/aliyun-oss-deploy

## Dependencies (7)

- [co](https://npm.io/package/co.md) ^4.6.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^11.0.0
- [globby](https://npm.io/package/globby.md) ^8.0.1
- [ali-oss](https://npm.io/package/ali-oss.md) ^5.2.0
- [figures](https://npm.io/package/figures.md) ^2.0.0
- [terminal-link](https://npm.io/package/terminal-link.md) ^1.3.0

## Recent versions

- 0.1.5 (latest) — 2019-07-22
- 0.1.3 — 2018-05-18
- 0.1.2 — 2018-05-18
- 0.1.1 — 2018-05-16
- 0.1.0 — 2018-05-14
- 0.0.5 — 2018-05-14
- 0.0.4 — 2018-05-14
- 0.0.3 — 2018-05-14
- 0.0.2 — 2018-05-10
- 0.0.1 — 2018-05-10

## README

# aliyun-oss-deploy

> 一个用于部署静态资源到 aliyun oss 的模块，支持 putObject 和 putStream。可以代码方式或者 cli 方式调用！

[![npm](https://img.shields.io/npm/v/aliyun-oss-deploy.svg)](https://www.npmjs.com/package/aliyun-oss-deploy)
[![npm](https://img.shields.io/npm/dm/aliyun-oss-deploy.svg)](https://www.npmjs.com/package/aliyun-oss-deploy)

![image](https://user-images.githubusercontent.com/7856674/40217123-aa5df822-5a9d-11e8-8b2d-5488967e3fcc.png)

## Install

```bash
npm i --save-dev aliyun-oss-deploy
```


## Usage

 - 代码方式

```js
const deploy = require('aliyun-oss-deploy');

deploy(path, ossConfig[, prefix, byStream]);
```

**注意**：prefix 用来配置资源版本号比较合适，默认为空；byStream 默认为 false，表示使用 putObject 方法！


 - CLI 方式

```bash
aliyun-oss-deploy -p ./dist -c .aliossrc -d static
```

帮助文档：

```bash
aliyun-oss-deploy --help
Options:
  --version        Show version number           [boolean]
  -p, --filePath   Set your upload files path     [string]
  -d, --prefix     Set the target dir of upload   [string]
  -c, --aliossrc   Set your .aliossrc file path   [string]
  -s, --useStream  Upload file by putStream      [boolean]
  --help           Show help                     [boolean]
```


可以在 package.json 中直接使用

```json
{
  "script": {
    "deploy": "aliyun-oss-deploy -p ./dist"
  }
}
```


## Config

> 无论是代码方式还是 cli 方式，aliyun oss 配置文件都是下面的数据结构！

**需要注意的是**：对于 CLI 方法，配置文件必须是 JSON 格式（双引号）！


```js
{
  "accessKeyId": "your accessKeyId",
  "accessKeySecret": "your accessKeySecret",
  "region": "your region",
  "bucket": "your bucket"
}
```

**注意**：`region` 是区分 endpoint 的区域分类。


## License

ISC@[hustcc](https://github.com/hustcc).

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