@voyo/ali-cdn
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

安装

npm i @voyo/ali-cdn

例子

const {AliYoCDN}= require("@voyo/ali-cdn");

const cdn=new AliYoCDN({
  cdnKey: "your key", //阿里云accessKeyId
  cdnSecret: "your secret", // 阿里云accessKeySecret
})

//刷新cdn url;
cdn.refreshUrl("https://www.xxx.com/xx.jpg")
  .then(result=>{})
//批量刷新
cdn.refreshUrl([
  "https://www.xxx.com/1.jpg",
  "https://www.xxx.com/2.jpg"
]) 

API

  • refreshUrl(url: string|string[]) 刷新url
  • refreshDir(dir: string|string[]) 刷新目录
  • pushUrl(url: string|string[], area:string= "domestic") 预热url
  • describeQuota() 查询配额信息
  • describeTasks (p: describeTasksParams) 查询刷新预热信息
type describeTasksParams={
    TaskId?:string;
    ObjectPath?:string;
    PageNumber?: number;
    ObjectType?:"file"|"directory"|"preload";
    DomainName?:string;
    Status?:string;
    PageSize?:string;
    StartTime?:string;
    EndTime?:string;
    ResourceGroupId?:string;
  }

Package Sidebar

Install

npm i @voyo/ali-cdn

Weekly Downloads

4

Version

1.0.3

License

ISC

Unpacked Size

13.3 kB

Total Files

6

Last publish

Collaborators

  • zhantewei
  • echo_hx
  • lansang
  • lousicong
  • buildstrap