@ricsam/quickjs-fetch 0.2.17 → 0.2.19

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 CHANGED
@@ -1,6 +1,16 @@
1
1
  # @ricsam/quickjs-fetch
2
2
 
3
- Fetch API and HTTP server handler.
3
+ Fetch API and HTTP server handler for QuickJS runtime.
4
+
5
+ > **Note**: This is a low-level package. For most use cases, use [`@ricsam/quickjs-runtime`](../runtime) with `createRuntime()` instead.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ bun add @ricsam/quickjs-fetch
11
+ ```
12
+
13
+ ## Setup
4
14
 
5
15
  ```typescript
6
16
  import { setupFetch } from "@ricsam/quickjs-fetch";
@@ -14,12 +24,13 @@ const handle = setupFetch(context, {
14
24
  });
15
25
  ```
16
26
 
17
- **Injected Globals:**
27
+ ## Injected Globals
28
+
18
29
  - `fetch`, `Request`, `Response`, `Headers`
19
30
  - `FormData`, `AbortController`, `AbortSignal`
20
31
  - `serve` (HTTP server handler)
21
32
 
22
- **Usage in QuickJS:**
33
+ ## Usage in QuickJS
23
34
 
24
35
  ```javascript
25
36
  // Outbound fetch
@@ -53,7 +64,7 @@ formData.append("name", "John");
53
64
  formData.append("file", new File(["content"], "file.txt"));
54
65
  ```
55
66
 
56
- #### HTTP Server
67
+ ## HTTP Server
57
68
 
58
69
  Register a server handler in QuickJS and dispatch requests from the host:
59
70
 
@@ -109,4 +120,4 @@ if (upgrade?.requested) {
109
120
  // Forward incoming messages
110
121
  handle.dispatchWebSocketMessage(connectionId, "Hello from client");
111
122
  }
112
- ```
123
+ ```
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/quickjs-fetch",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "type": "commonjs"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/quickjs-fetch",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "type": "module"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/quickjs-fetch",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "types": "./dist/types/index.d.ts",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "typecheck": "tsc --noEmit"
20
20
  },
21
21
  "dependencies": {
22
- "@ricsam/quickjs-core": "^0.2.15",
22
+ "@ricsam/quickjs-core": "^0.2.16",
23
23
  "quickjs-emscripten": "^0.31.0"
24
24
  },
25
25
  "peerDependencies": {