Tencent cos-nodejs-sdk wrapper.
npm install -S @jswork/next-tx-cos-sdk
api | params | description |
---|---|---|
get | - | desc balabala |
put | - | desc balabala |
del | - | desc balabala |
import NxTxCosSdk from '@jswork/next-tx-cos-sdk';
const config = {
id: 'xxx',
SecretId: 'xxxx',
SecretKey: 'xxxxx'
};
// https://console.cloud.tencent.com/cos5/bucket
const nxCos = new NxTxCosSdk(config);
// create
nxCos
.get({
Bucket: 'img3-1301823685',
Region: 'ap-chengdu'
})
.then((res) => {
console.log(res);
});
// // get
// nxCos.get().then((res) => {
// console.log(res);
// });
// //delete
// nxCos
// .del({
// Bucket: 'img1-xxx',
// Region: 'ap-chengdu'
// })
// .catch((err) => {
// console.log(err);
// });
- https://github.com/sindresorhus/pify
- https://cloud.tencent.com/document/product/436/8629
- https://cloud.tencent.com/document/product/436/36119
Code released under the MIT license.