@ricsam/isolate-encoding 0.1.3 → 0.1.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.
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @ricsam/isolate-encoding
2
2
 
3
- Base64 encoding and decoding via `atob` and `btoa`.
3
+ Base64 encoding and decoding via `atob` and `btoa` for isolated-vm V8 sandbox.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm add @ricsam/isolate-encoding
9
+ ```
10
+
11
+ ## Usage
4
12
 
5
13
  ```typescript
6
14
  import { setupEncoding } from "@ricsam/isolate-encoding";
@@ -8,11 +16,12 @@ import { setupEncoding } from "@ricsam/isolate-encoding";
8
16
  const handle = await setupEncoding(context);
9
17
  ```
10
18
 
11
- **Injected Globals:**
19
+ ## Injected Globals
20
+
12
21
  - `atob(encodedData)` - Decode a Base64-encoded string
13
22
  - `btoa(stringToEncode)` - Encode a string to Base64
14
23
 
15
- **Usage in Isolate:**
24
+ ## Usage in Isolate
16
25
 
17
26
  ```javascript
18
27
  // Encode string to Base64
@@ -31,7 +40,7 @@ const base64Data = btoa(JSON.stringify(data));
31
40
  const originalData = JSON.parse(atob(base64Data));
32
41
  ```
33
42
 
34
- **Error Handling:**
43
+ ## Error Handling
35
44
 
36
45
  ```javascript
37
46
  // btoa throws for characters outside Latin1 range (0-255)
@@ -47,4 +56,8 @@ try {
47
56
  } catch (e) {
48
57
  console.error("Invalid Base64 string");
49
58
  }
50
- ```
59
+ ```
60
+
61
+ ## License
62
+
63
+ MIT
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-encoding",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "type": "commonjs"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-encoding",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "type": "module"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-encoding",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "types": "./dist/types/index.d.ts",
6
6
  "exports": {