1.0.0 • Published 9 years ago
iooly-aliyun-cdn v1.0.0
refresh-aliyun-cdn
simplify aliyun-sdk for refreshing aliyun CDN
Features
###1. Refresh Aliyun CDN file, files and dir simply.
- cdn.refreshDir(http://xx.xx.xx/img/);
- cdn.refreshFile(http://xx.xx.xx/img/1.png);
- cdn.refreshFiles(http://xx.xx.xx/img/1.png, http://xx.xx.xx/img/2.png, ...);
###2. ES5 Generator Support
- yield cdn.refreshDir(http://xx.xx.xx/img/);
- yield cdn.refreshFile(http://xx.xx.xx/img/1.png);
- yield cdn.refreshFiles(http://xx.xx.xx/img/1.png, http://xx.xx.xx/img/2.png, ...);
##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
1.0.0
9 years ago