exarch-rs 0.1.2 → 0.2.0

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/Cargo.toml CHANGED
@@ -17,7 +17,7 @@ crate-type = ["cdylib"]
17
17
  exarch-core.workspace = true
18
18
  napi = { workspace = true, features = ["async", "napi4", "error_anyhow", "tokio_rt"] }
19
19
  napi-derive.workspace = true
20
- tokio.workspace = true
20
+ tokio = { workspace = true, features = ["rt"] }
21
21
 
22
22
  [build-dependencies]
23
23
  napi-build.workspace = true
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/bug-ops/exarch/ci.yml?branch=main)](https://github.com/bug-ops/exarch/actions)
7
7
  [![License](https://img.shields.io/npm/l/exarch-rs)](../../LICENSE-MIT)
8
8
 
9
- Memory-safe archive extraction library for Node.js.
9
+ Memory-safe archive extraction and creation library for Node.js.
10
10
 
11
11
  > [!IMPORTANT]
12
12
  > **exarch** is designed as a secure replacement for vulnerable archive libraries like `tar-fs`, which has known CVEs with CVSS scores up to 9.4.
@@ -38,6 +38,8 @@ bun add exarch-rs
38
38
 
39
39
  ## Quick Start
40
40
 
41
+ ### Extraction
42
+
41
43
  ```javascript
42
44
  const { extractArchive } = require('exarch-rs');
43
45
 
@@ -46,6 +48,16 @@ const result = await extractArchive('archive.tar.gz', '/output/path');
46
48
  console.log(`Extracted ${result.filesExtracted} files`);
47
49
  ```
48
50
 
51
+ ### Creation
52
+
53
+ ```javascript
54
+ const { createArchive } = require('exarch-rs');
55
+
56
+ // Async (recommended)
57
+ const result = await createArchive('backup.tar.gz', ['src/', 'package.json']);
58
+ console.log(`Created archive with ${result.filesAdded} files`);
59
+ ```
60
+
49
61
  ## Usage
50
62
 
51
63
  ### Async API (Recommended)
@@ -178,14 +190,18 @@ The library provides built-in protection against:
178
190
 
179
191
  ## Supported Formats
180
192
 
181
- | Format | Extensions |
182
- |--------|------------|
183
- | TAR | `.tar` |
184
- | TAR+GZIP | `.tar.gz`, `.tgz` |
185
- | TAR+BZIP2 | `.tar.bz2`, `.tbz2` |
186
- | TAR+XZ | `.tar.xz`, `.txz` |
187
- | TAR+ZSTD | `.tar.zst`, `.tzst` |
188
- | ZIP | `.zip` |
193
+ | Format | Extensions | Extract | Create |
194
+ |--------|------------|:-------:|:------:|
195
+ | TAR | `.tar` | ✅ | ✅ |
196
+ | TAR+GZIP | `.tar.gz`, `.tgz` | ✅ | ✅ |
197
+ | TAR+BZIP2 | `.tar.bz2`, `.tbz2` | ✅ | ✅ |
198
+ | TAR+XZ | `.tar.xz`, `.txz` | ✅ | ✅ |
199
+ | TAR+ZSTD | `.tar.zst`, `.tzst` | ✅ | ✅ |
200
+ | ZIP | `.zip` | ✅ | ✅ |
201
+ | 7z | `.7z` | ✅ | — |
202
+
203
+ > [!NOTE]
204
+ > 7z creation is not yet supported. Solid and encrypted 7z archives are rejected for security reasons.
189
205
 
190
206
  ## Comparison with tar-fs
191
207
 
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exarch-rs",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Memory-safe archive extraction library with built-in security validation",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",