UNPKG

3.25 kBMarkdownView Raw
1<p align="center">
2 Help axios-cache-interceptor grow! Star and share this amazing repo with your friends and co-workers!
3</p>
4
5<br />
6
7[![Issues](https://img.shields.io/github/issues/arthurfiorette/axios-cache-interceptor?logo=github&label=Issues)](https://github.com/arthurfiorette/axios-cache-interceptor/issues)
8[![Stars](https://img.shields.io/github/stars/arthurfiorette/axios-cache-interceptor?logo=github&label=Stars)](https://github.com/arthurfiorette/axios-cache-interceptor/stargazers)
9[![License](https://img.shields.io/github/license/arthurfiorette/axios-cache-interceptor?logo=githu&label=License)](https://github.com/arthurfiorette/axios-cache-interceptor/blob/main/LICENSE)
10[![Try on Runkit](https://img.shields.io/badge/try%20on-RunKit-brightgreen?logo=runkit&logoColor=e83e8c)](https://npm.runkit.com/axios-cache-interceptor)
11[![Codecov](https://codecov.io/gh/arthurfiorette/axios-cache-interceptor/branch/main/graph/badge.svg?token=ML0KGCU0VM)](https://codecov.io/gh/arthurfiorette/axios-cache-interceptor)
12[![Downloads](https://img.shields.io/npm/dw/axios-cache-interceptor?style=flat)](https://www.npmjs.com/package/axios-cache-interceptor)
13[![Bundlephobia](https://img.shields.io/bundlephobia/minzip/axios-cache-interceptor/latest?style=flat)](https://bundlephobia.com/package/axios-cache-interceptor@latest)
14[![Packagephobia](https://packagephobia.com/badge?p=axios-cache-interceptor@latest)](https://packagephobia.com/result?p=axios-cache-interceptor@latest)
15[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor?ref=badge_shield)
16[![Join the chat at https://gitter.im/axios-cache-interceptor/community](https://badges.gitter.im/axios-cache-interceptor/community.svg)](https://gitter.im/axios-cache-interceptor/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
17
18<br />
19
20<div align="center">
21 <pre>
22 <h1>
23Axios Cache Interceptor</h1>
24 </pre>
25 <br />
26</div>
27
28<h3 align="center">
29 <code>Axios Cache Interceptor</code> is a small and efficient cache interceptor for axios.
30 <br />
31 <br />
32</h3>
33
34<br />
35
36```ts
37import Axios from 'axios';
38import { setupCache } from 'axios-cache-interceptor';
39
40// same object, but with updated typings.
41const axios = setupCache(Axios);
42
43const req1 = axios.get('https://api.example.com/');
44const req2 = axios.get('https://api.example.com/');
45
46const [res1, res2] = await Promise.all([req1, req2]);
47
48res1.cached; // false
49res2.cached; // true
50```
51
52<br />
53
54<h3 align=center>
55 <a href="https://axios-cache-interceptor.js.org/" target="_blank">Documentation at <code>axios-cache-interceptor.js.org</code> 🎉🎉</a>
56</h3>
57
58<br />
59
60## License
61
62Licensed under the **MIT**. See [`LICENSE`](LICENSE) for more informations.
63
64[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Farthurfiorette%2Faxios-cache-interceptor?ref=badge_small)
65
66<br />
67
68## Contact
69
70See my contact information on my [github profile](https://github.com/arthurfiorette) or
71open a new issue.
72
73<br />