@jmus/underrated-fetch 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +28 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🐶 underrated-fetch
1
+ # 🐶 Underrated-fetch
2
2
 
3
3
  ![CI](https://github.com/jamus/orbitq-app/actions/workflows/ci.yml/badge.svg)
4
4
  [![npm version](https://img.shields.io/npm/v/@jmus/underrated-fetch.svg)](https://www.npmjs.com/package/@jmus/underrated-fetch)
@@ -10,6 +10,33 @@ A simple **Node.js** wrapper around `fetch` that adds **TTL-based caching** for
10
10
 
11
11
  Designed to reduce redundant outbound requests and avoid rate limits when calling external APIs.
12
12
 
13
+ ### Example usage
14
+
15
+ ```mermaid
16
+ flowchart LR
17
+ Mobile["Mobile App"] --> App["Node Service"]
18
+ App --> UF["🐶 Underrated fetch"]
19
+
20
+ %% Combined optional cache block
21
+ UF --> OptionalCache["Cache:<br>A) In Memory <br>B) Redis Shared Cache <br>C) Other Options"]
22
+
23
+ %% Cache hit/miss
24
+ OptionalCache -- cache hit --> UF
25
+ OptionalCache -- cache miss --> UF
26
+
27
+ %% Fetch network
28
+ UF --> Fetch["Fetch API"]
29
+ Fetch --> API["External API"]
30
+ API --> Fetch
31
+
32
+ %% Store results
33
+ UF -- store --> OptionalCache
34
+
35
+ %% App return
36
+ UF --> App
37
+ App --> Mobile
38
+ ```
39
+
13
40
  ---
14
41
 
15
42
  ## Why?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmus/underrated-fetch",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Simple caching for outbound requests",
5
5
  "publishConfig": {
6
6
  "access": "public"