@pagepocket/cli 0.4.0 → 0.4.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 +40 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @pagepocket/cli
|
|
2
|
+
|
|
3
|
+
CLI for capturing offline snapshots of web pages. It fetches HTML, records network
|
|
4
|
+
responses, downloads assets, rewrites links to local files, and injects a replay
|
|
5
|
+
script so the snapshot works offline.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g @pagepocket/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pp https://example.com
|
|
17
|
+
pp https://example.com -o ./snapshots
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Output
|
|
21
|
+
|
|
22
|
+
Snapshots are written to the current directory by default:
|
|
23
|
+
|
|
24
|
+
- `*.html`: offline snapshot page
|
|
25
|
+
- `*.requests.json`: recorded requests/responses
|
|
26
|
+
- `*_files/`: downloaded assets
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
|
|
30
|
+
Environment variables:
|
|
31
|
+
|
|
32
|
+
- `PAGEPOCKET_FETCH_TIMEOUT_MS` (default: `60000`)
|
|
33
|
+
- `PAGEPOCKET_FETCH_HEADERS` (JSON string of extra headers)
|
|
34
|
+
|
|
35
|
+
## Development
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pnpm install
|
|
39
|
+
pnpm --filter @pagepocket/cli build
|
|
40
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagepocket/cli",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "CLI for capturing offline snapshots of web pages.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"pp": "dist/index.js"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"chalk": "^4.1.2",
|
|
19
19
|
"got": "^11.8.6",
|
|
20
20
|
"ora": "^9.0.0",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"lighterceptor": "npm:@pagepocket/lighterceptor@0.4.1",
|
|
22
|
+
"@pagepocket/lib": "0.4.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^20.11.30",
|