Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
docs: 更新使用文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexb committed May 2, 2018
1 parent f5b1e62 commit e517528
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@ $ [sudo] npm i mip-cache
## 使用

```js
var Mip = require('mip-cache');
var app = new Mip({
var Cache = require('mip-cache');
var app = new Cache({
// 站长平台的授权key
authkey: ''
});

// 推送数据
// 推送清理数据
// app.clear(url) => Promise
app.clear('http://mip.xuexb.com').then(res => {
console.log(res);
}).catch(err => {
console.error(err);
});

// 清理 HTTPS 数据
app.clear('https://mip.xuexb.com').then(res => {
console.log(res);
}).catch(err => {
console.error(err);
});
```

## cli
Expand All @@ -39,6 +46,10 @@ $ [sudo] npm i mip-cache -g

# 使用命令清除
mip-cache --authkey 站长平台的authkey url

#
mip-cache --authkey demokey mip.xuexb.com
mip-cache --authkey demokey https://mip.xuexb.com
```

## 成功响应
Expand Down Expand Up @@ -93,6 +104,10 @@ mip-cache --authkey 站长平台的authkey url

## 更新日志

### 1.0.2

- 修复无法清理 HTTPS 链接,fix #2

### 1.0.0

- 优化测试, 使用`promise`
Expand Down

0 comments on commit e517528

Please sign in to comment.