1.0.0 • Published 9 years ago

iooly-aliyun-cdn v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

refresh-aliyun-cdn

simplify aliyun-sdk for refreshing aliyun CDN

Features

###1. Refresh Aliyun CDN file, files and dir simply.

###2. ES5 Generator Support

##Guide ###1. Get the cdn instance

  • common one:
const cdn = new (loadLib('iooly-aliyun-cdn'))({
    "accessKeyId": "xxxxxxx",
    "secretAccessKey": "xxxxxxxxxxxxxx",
    "endpoint": "https://cdn.aliyuncs.com"
});
  • ES5 Generator one
const cdn = new (loadLib('iooly-aliyun-cdn').co)({
    "accessKeyId": "xxxxxxx",
    "secretAccessKey": "xxxxxxxxxxxxxx",
    "endpoint": "https://cdn.aliyuncs.com"
});

###2. config

Just find accessKeyId, secretAccessKey and endpoint in aliyun-sdk

###3. refresh object

  • refresh file
// common one
cdn.refreshFile('http://sss/xxx/ss.jpg', function(err, result){

});

// ES5 Generator one
let result = yield cdn.refreshFile('http://sss/xxx/ss.jpg');
  • refresh directory
cdn.refreshDir('http://sss/xxx/', function(err, result){

});

// ES5 Generator one
let result = yield cdn.refreshDir('http://sss/xxx/');

##Installation

$ npm i -S refresh-aliyun-cdn

##Dependencies

##Authors

License