@laphilosophia/api-tape 1.2.0 β 1.2.1
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.
- package/README.md +18 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# API Tape
|
|
2
2
|
|
|
3
3
|
**Record and Replay HTTP API responses for offline development.**
|
|
4
4
|
|
|
5
5
|
API Tape is a zero-config CLI tool that acts as a transparent HTTP proxy. It records API responses to local JSON files ("tapes") and replays them instantlyβperfect for offline development, flaky API testing, and reproducible demos.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
9
|
+
- **Record Mode** β Proxies requests to your target API and saves responses
|
|
10
|
+
- **Replay Mode** β Serves cached responses instantly from disk
|
|
11
|
+
- **Hybrid Mode** β Replays cached tapes, falls back to upstream on cache miss
|
|
12
|
+
- **Tape Management Commands** β List, inspect, clear, and prune tapes from CLI
|
|
13
|
+
- **Header Redaction** β Mask sensitive response headers before writing tapes
|
|
14
|
+
- **Zero Config** β Works out of the box with sensible defaults
|
|
15
|
+
- **Binary Safe** β Handles images, compressed responses, and any content type
|
|
16
|
+
- **Replay Header** β Responses include `X-Api-Tape: Replayed` for easy debugging
|
|
17
|
+
- **Versioned Tape Schema** β Each tape includes `schemaVersion` for compatibility checks
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Installation
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
npm install -g api-tape
|
|
@@ -28,7 +28,7 @@ Or use it directly with npx:
|
|
|
28
28
|
npx api-tape --target "https://api.example.com" --mode record
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## Quick Start
|
|
32
32
|
|
|
33
33
|
### Step 1: Record API Responses
|
|
34
34
|
|
|
@@ -70,7 +70,7 @@ tape --target "https://jsonplaceholder.typicode.com" --mode hybrid --record-on-m
|
|
|
70
70
|
- If tape is missing β upstream request is proxied.
|
|
71
71
|
- With `--record-on-miss true`, miss responses are automatically saved as new tapes.
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## CLI Options
|
|
74
74
|
|
|
75
75
|
### Serve command
|
|
76
76
|
|
|
@@ -94,7 +94,7 @@ tape tape clear --yes --dir ./tapes
|
|
|
94
94
|
tape tape prune --older-than 30 --dir ./tapes
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
##
|
|
97
|
+
## Tape Format
|
|
98
98
|
|
|
99
99
|
Each tape is a JSON file named with an MD5 hash of `METHOD|URL`:
|
|
100
100
|
|
|
@@ -114,20 +114,20 @@ Each tape is a JSON file named with an MD5 hash of `METHOD|URL`:
|
|
|
114
114
|
|
|
115
115
|
The body is base64-encoded for binary safety.
|
|
116
116
|
|
|
117
|
-
##
|
|
117
|
+
## Development
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
npm run build
|
|
121
121
|
npm test
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
##
|
|
124
|
+
## Use Cases
|
|
125
125
|
|
|
126
126
|
- **Offline Development** β Work without internet or VPN
|
|
127
127
|
- **Flaky API Testing** β Eliminate network inconsistencies in tests
|
|
128
128
|
- **Demo Environments** β Reproducible API responses for presentations
|
|
129
129
|
- **Rate Limit Bypass** β Develop against recorded responses
|
|
130
130
|
|
|
131
|
-
##
|
|
131
|
+
## License
|
|
132
132
|
|
|
133
133
|
MIT Β© [Erdem Arslan](https://github.com/laphilosophia)
|