Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Jun 28, 2017
0 parents commit 054e1c1
Show file tree
Hide file tree
Showing 21 changed files with 12,312 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
node_modules
package-lock.json
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# cos-js-sdk-v5

腾讯云 COS JS SDK([XML API](https://www.qcloud.com/document/product/436/7751)

[releases and changelog](https://github.com/tencentyun/cos-js-sdk-v5/releases)

## npm 安装

[npm 地址](https://www.npmjs.com/package/cos-js-sdk-v5)

```
npm i cos-js-sdk-v5 --save
```

## get started

```javascript
var cos = new COS({
AppId: '1250000000',
getAuthorization: function (options, callback) {
$.get('../server/auth.php', {
method: (options.method || 'get').toLowerCase(),
pathname: options.pathname || '/'
}, function (authorization) {
callback(authorization);
}, 'text');
}
});
// 分片上传
cos.sliceUploadFile({
Bucket: 'test',
Region: 'cn-south',
Key: '1.zip',
Body: file
}, function (err, data) {
console.log(err, data);
});
```

[更多例子](demo/demo.js)
5 changes: 5 additions & 0 deletions demo/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var config = {
AppId: '1250000000',
Bucket: 'test',
Region: 'cn-south'
};
Loading

0 comments on commit 054e1c1

Please sign in to comment.