项目作者: fjc0k

项目描述 :
基于配置的七牛缓存刷新命令行工具。
高级语言: JavaScript
项目地址: git://github.com/fjc0k/qiniu-cache-refresh.git
创建时间: 2018-07-19T05:04:55Z
项目社区:https://github.com/fjc0k/qiniu-cache-refresh

开源协议:

下载


qiniu-cache-refresh

基于配置的七牛缓存刷新命令行工具。

安装

  1. yarn add qiniu-cache-refresh -D
  2. // 或者
  3. npm i qiniu-cache-refresh -D

用法

配置

在项目根目录下新建 qiniu.config.js 文件,写入配置:

  1. module.exports = {
  2. accessKey: 'Access 密钥',
  3. secretKey: 'Secret 密钥',
  4. cacheRefresh: {
  5. urls: [
  6. 'https://foo.bar/about.html',
  7. 'https://foo.bar/sitemap.html'
  8. // 更多 url
  9. ],
  10. dirs: [
  11. 'https://foo.bar/images',
  12. 'https://foo.bar/pages'
  13. // 更多目录
  14. ]
  15. }
  16. }

使用

  1. yarn qiniu-cache-refresh
  2. // 或者
  3. npx qiniu-cache-refresh

package.json 中你可以这么使用:

  1. {
  2. "scripts": {
  3. "deploy:qiniu": "qiniu-cache-refresh"
  4. }
  5. }