# cdn-upyun

> Upload your files to upyun cdn.

Latest version **1.0.0** (published 2014-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install cdn-upyun
pnpm add cdn-upyun
yarn add cdn-upyun
bun add cdn-upyun
```

Provides the command `cdn`.

## 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.0 |
| Published | 2014-07-31 |
| First published | 2014-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16 |
| Author | afc163 |
| Maintainers | afc163 |
| Keywords | cdn, upload |

## Links

- npm: https://www.npmjs.com/package/cdn-upyun
- Repository: https://github.com/afc163/cdn
- Issues: https://github.com/afc163/cdn/issues
- npm.io page: https://npm.io/package/cdn-upyun

## Dependencies (10)

- [async](https://npm.io/package/async.md) ^0.9.0
- [upyun](https://npm.io/package/upyun.md) 0.0.3
- [shelljs](https://npm.io/package/shelljs.md) ^0.3.0
- [cliparoo](https://npm.io/package/cliparoo.md) ^1.0.0
- [colorful](https://npm.io/package/colorful.md) ^2.1.0
- [download](https://npm.io/package/download.md) ^0.1.18
- [tempfile](https://npm.io/package/tempfile.md) ^0.1.3
- [commander](https://npm.io/package/commander.md) ~2.2.0
- [imageinfo](https://npm.io/package/imageinfo.md) ^1.0.4
- [uglify-js](https://npm.io/package/uglify-js.md) ^2.4.14

## Recent versions

- 1.0.0 (latest) — 2014-07-31

## README

# CDN

[![NPM version](https://img.shields.io/npm/v/cdn.svg?style=flat)](https://npmjs.org/package/cdn)

上传静态文件到又拍云服务器上，生成随机的地址返回。目前支持 .png .jpg .jpeg .gif .ico .swf .js .css .zip .pdf .flv .mp4 这些类型的文件。

![demo](https://i.alipayobjects.com/e/201312/1fOQnfM67D.png)

---

## 安装

```
$ npm install cdn -g
```

## 使用

```
$ cdn test.jpg
```

```
Start checking files.
Ready to upload one file:
  index.js @ application/x-javascript 0.71 KB
Busy in uploading ....
  ➜  http://cdn-upyun.b0.upaiyun.com/1a7a1f11b9d87c5b5e3f55749fb98a88.png ~ cnima.js
Uploaded one file to Alipay cdn in 0.863s!
```

就可以访问 http://cdn-upyun.b0.upaiyun.com/1a7a1f11b9d87c5b5e3f55749fb98a88.png 了。

上传成功后 cdn 地址将会自动复制到剪贴板中。

### 多文件部署

支持多文件上传和通配符的匹配。

```
$ cdn test1.js test2.js test3.css
```

```
$ cdn *.jpg
```

### 部署网络地址

```
$ cdn https://www.npmjs.org/static/img/npm.png
```

### 相对绝对路径

```
$ cdn ../../test.jpg
```

```
$ cdn /home/admin/test.jpg
```

### 在 NodeJS 中

```js
var cdn = require('cdn');

cdn('/path/to/test.jpg', function(err, url) {
    // url -> http://cdn-upyun.b0.upaiyun.com/1a7a1f11b9d87c5b5e3f55749fb98a88.png
});
```

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