cdp-client-tool 1.0.0 → 1.0.2
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/package.json +1 -1
- package/readme.md +2 -19
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
一个客户端程序,通过 Socket.IO 与 HTTP 接口与网关通信,用于控制浏览器、抓取数据等。适用于在安卓机 / Linux 上运行的数据抓取 Client。
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- **包名**:`cdp-client-tool`
|
|
6
6
|
- **入口**:`Client`、`EVENTS`、类型 `ClientOptions` / `GatewayConfig` / `excuteFn`
|
|
7
7
|
|
|
8
8
|
## 快速开始
|
|
@@ -16,7 +16,7 @@ pnpm run build
|
|
|
16
16
|
**作为客户端连接网关:**
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import { Client } from "
|
|
19
|
+
import { Client } from "cdp-client-tool";
|
|
20
20
|
|
|
21
21
|
const client = new Client({
|
|
22
22
|
deviceName: "my-device", // 网关侧展示的设备名
|
|
@@ -179,20 +179,3 @@ Base 示例:`http://localhost:3000`。路径统一为虚拟路径:`/{device_
|
|
|
179
179
|
虚拟结构:`/{device_name}/local_scripts/...`、`/{device_name}/screenshots/...`,path 须落在此两棵树下,否则 400。
|
|
180
180
|
|
|
181
181
|
---
|
|
182
|
-
|
|
183
|
-
## 需要解决的问题
|
|
184
|
-
|
|
185
|
-
- 内存泄漏
|
|
186
|
-
- 网络超时
|
|
187
|
-
- 执行队列
|
|
188
|
-
- 客户端文件管理(脚本 / 截图)
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## 发布到 npm
|
|
193
|
-
|
|
194
|
-
1. **完善 package.json**(可选):填写 `repository.url`(如 `git+https://github.com/xxx/cdp-client-tool.git`)、`author`。
|
|
195
|
-
2. **登录 npm**:`npm login`(未账号则到 [npmjs.com](https://www.npmjs.com/) 注册)。
|
|
196
|
-
3. **发包**:在仓库根目录执行 `pnpm run build` 后执行 `npm publish`。
|
|
197
|
-
- 作用域包 `@bomon/cdp-client-tool` 已配置 `"publishConfig": { "access": "public" }`,会以公开包发布。
|
|
198
|
-
- 若需改版本再发:`npm version patch` 或 `minor` / `major`,再 `npm publish`。
|