refresh-aliyun-cdn

2.1.1 • Public • Published

refresh-aliyun-cdn

simplify aliyun-sdk for refreshing aliyun CDN

Features

Refresh Aliyun CDN file, files and dir simply.

Guide

1. Get the cdn instance

import { CDN } from 'refresh-aliyun-cdn';

const cdn = new CDN({
  accessKeyId: "a key",
  accessKeySecret: "a secret"
});

(async () => {
  const res = await cdn.refreshFile("a url");
  const result:RefreshResult = res.data; 
  
  console.log(result);
})();

2. refresh object

  • refresh single file
const {data} = await cdn.refreshFile('http://sss/xxx/ss.jpg');
  • refresh directory
const {data} = await cdn.refreshDir('http://sss/xxx/';
  • refresh multiple files
const {data} = await cdn.refreshFiles([
    'http://sss/xxx/',
    'http://sss/yyy/',
    'http://sss/zzz/'
]);

Installation

npm i -S refresh-aliyun-cdn

Dependencies

Authors

LnsooXD

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i refresh-aliyun-cdn

Weekly Downloads

11

Version

2.1.1

License

MIT

Unpacked Size

13.3 kB

Total Files

21

Last publish

Collaborators

  • lnsoo