https://github.com/cnpm/upyun-storage
Upyun wrapper for cnpm
https://github.com/cnpm/upyun-storage
Last synced: 8 months ago
JSON representation
Upyun wrapper for cnpm
- Host: GitHub
- URL: https://github.com/cnpm/upyun-storage
- Owner: cnpm
- License: mit
- Created: 2014-07-31T03:43:45.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2019-10-04T23:30:10.000Z (over 6 years ago)
- Last Synced: 2024-10-31T15:09:32.346Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 374 KB
- Stars: 9
- Watchers: 19
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
upyun-storage (又拍云存储Node SDK)
=================================
该SDK用于访问和调用又拍云存储空间。使用本SDK前,请自行申请[又拍云](https://www.upyun.com/index.html)的使用权限,以及得到操作员账号。
## Features
本SDK已完成如下功能:
### 文件功能
- [x]上传文件
- [x]下载文件(含流式API)
- [x]获取文件信息
- [x]删除文件
- [x]创建目录
- [x]删除目录
- [x]获取目录文件列表
- [x]获取空间使用情况
### 图片处理接口
- [ ]图片处理
## Installation
```bash
$ npm install upyun-storage
```
## Usage
```
var upyun = require('upyun-storage');
// 创建客户端
var client = upyun.create('oprator', 'password', 'bucket');
// 上传文件
client.putFile('/path/to/file.jpg', '/file.jpg', function (err, data, res) {
if (err) {
console.log('出现错误: ' + err.message);
return;
}
console.log('上传成功');
});
// 下载文件
client.putFile('/path/to/file.jpg', '/file.jpg', function (err, data, res) {
if (err) {
console.log('出现错误: ' + err.message);
return;
}
console.log('上传成功');
});
```
更多细节,参见[API文档](http://cnpm.github.io/upyun-storage/api.html)。更多又拍云存储细节,参见[官方文档](http://docs.upyun.com/api/http_api/)
## License
The MIT [License](https://github.com/cnpm/upyun-storage/blob/master/LICENSE). feel free to use it.