tar-xz 5.0.1 → 6.1.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/README.md +352 -115
  3. package/SECURITY.md +103 -0
  4. package/lib/browser/create.d.ts +10 -17
  5. package/lib/browser/create.d.ts.map +1 -1
  6. package/lib/browser/create.js +76 -84
  7. package/lib/browser/create.js.map +1 -1
  8. package/lib/browser/extract.d.ts +12 -13
  9. package/lib/browser/extract.d.ts.map +1 -1
  10. package/lib/browser/extract.js +50 -25
  11. package/lib/browser/extract.js.map +1 -1
  12. package/lib/browser/index.d.ts +4 -4
  13. package/lib/browser/index.d.ts.map +1 -1
  14. package/lib/browser/index.js +4 -4
  15. package/lib/browser/index.js.map +1 -1
  16. package/lib/browser/list.d.ts +7 -11
  17. package/lib/browser/list.d.ts.map +1 -1
  18. package/lib/browser/list.js +23 -15
  19. package/lib/browser/list.js.map +1 -1
  20. package/lib/index.browser.d.ts +5 -4
  21. package/lib/index.browser.d.ts.map +1 -1
  22. package/lib/index.browser.js +4 -3
  23. package/lib/index.browser.js.map +1 -1
  24. package/lib/index.d.ts +6 -4
  25. package/lib/index.d.ts.map +1 -1
  26. package/lib/index.js +4 -3
  27. package/lib/index.js.map +1 -1
  28. package/lib/internal/to-async-iterable.browser.d.ts +18 -0
  29. package/lib/internal/to-async-iterable.browser.d.ts.map +1 -0
  30. package/lib/internal/to-async-iterable.browser.js +66 -0
  31. package/lib/internal/to-async-iterable.browser.js.map +1 -0
  32. package/lib/internal/to-async-iterable.d.ts +19 -0
  33. package/lib/internal/to-async-iterable.d.ts.map +1 -0
  34. package/lib/internal/to-async-iterable.js +73 -0
  35. package/lib/internal/to-async-iterable.js.map +1 -0
  36. package/lib/node/create.d.ts +10 -12
  37. package/lib/node/create.d.ts.map +1 -1
  38. package/lib/node/create.js +109 -124
  39. package/lib/node/create.js.map +1 -1
  40. package/lib/node/extract.d.ts +14 -17
  41. package/lib/node/extract.d.ts.map +1 -1
  42. package/lib/node/extract.js +199 -198
  43. package/lib/node/extract.js.map +1 -1
  44. package/lib/node/file.d.ts +82 -0
  45. package/lib/node/file.d.ts.map +1 -0
  46. package/lib/node/file.js +416 -0
  47. package/lib/node/file.js.map +1 -0
  48. package/lib/node/index.d.ts +3 -2
  49. package/lib/node/index.d.ts.map +1 -1
  50. package/lib/node/index.js +2 -2
  51. package/lib/node/index.js.map +1 -1
  52. package/lib/node/list.d.ts +9 -8
  53. package/lib/node/list.d.ts.map +1 -1
  54. package/lib/node/list.js +16 -73
  55. package/lib/node/list.js.map +1 -1
  56. package/lib/node/tar-parser.d.ts +38 -0
  57. package/lib/node/tar-parser.d.ts.map +1 -1
  58. package/lib/node/tar-parser.js +171 -8
  59. package/lib/node/tar-parser.js.map +1 -1
  60. package/lib/node/xz-helpers.d.ts +26 -0
  61. package/lib/node/xz-helpers.d.ts.map +1 -0
  62. package/lib/node/xz-helpers.js +69 -0
  63. package/lib/node/xz-helpers.js.map +1 -0
  64. package/lib/types.d.ts +55 -66
  65. package/lib/types.d.ts.map +1 -1
  66. package/lib/types.js +7 -0
  67. package/lib/types.js.map +1 -1
  68. package/package.json +11 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,136 @@
1
+ # tar-xz
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [6.1.0] - 2026-04-29
6
+
7
+ ### ⚠️ BREAKING CHANGES
8
+ - redesign for v6 — universal stream-first API (#108) (tar-xz) ([b2c8a8c](https://github.com/oorabona/node-liblzma/commit/b2c8a8c))
9
+
10
+ ### Added
11
+ - true streaming for Node extract()/list() — O(largest entry) (#113) (tar-xz) ([06a9937](https://github.com/oorabona/node-liblzma/commit/06a9937))
12
+ - wire memlimit through N-API decoder (#112) (native) ([0d09200](https://github.com/oorabona/node-liblzma/commit/0d09200))
13
+ - wire memlimit option through unxzAsync/unxz (#111) (wasm) ([6e2bc09](https://github.com/oorabona/node-liblzma/commit/6e2bc09))
14
+ - adopt Changesets for monorepo versioning + changelog generation (ci) ([adfbc99](https://github.com/oorabona/node-liblzma/commit/adfbc99))
15
+ - redesign for v6 — universal stream-first API (#108) (tar-xz) ⚠️ BREAKING ([b2c8a8c](https://github.com/oorabona/node-liblzma/commit/b2c8a8c))
16
+
17
+ ### Fixed
18
+ - close Win32 symlink-swap TOCTOU with JS-pure 'wx'+retry fail-closed (#114) (tar-xz) ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
19
+ - re-add @changesets/cli (was clobbered by pnpm add of changelog-github) (deps) ([6d76280](https://github.com/oorabona/node-liblzma/commit/6d76280))
20
+ - use 'changeset' so the bin resolves with --ignore-scripts (ci) ([78b91f7](https://github.com/oorabona/node-liblzma/commit/78b91f7))
21
+ - toAsyncIterable mis-dispatched Uint8Array via Symbol.iterator ([b2c8a8c](https://github.com/oorabona/node-liblzma/commit/b2c8a8c))
22
+ - use always() in publish job to bypass skipped build (workspace target) (ci) ([2e08977](https://github.com/oorabona/node-liblzma/commit/2e08977))
23
+ - pin pnpm/action-setup to v5 in refresh-lockfile (v6 corrupts lockfile) (ci) ([f39d603](https://github.com/oorabona/node-liblzma/commit/f39d603))
24
+ - regenerate pnpm-lock.yaml (was broken with duplicate YAML document) (deps) ([e0c66ab](https://github.com/oorabona/node-liblzma/commit/e0c66ab))
25
+ - use squash merge in Dependabot auto-merge (linear history required) (ci) ([f3aee60](https://github.com/oorabona/node-liblzma/commit/f3aee60))
26
+ - point tar-xz demo Vite alias to browser entry ([8aea7ac](https://github.com/oorabona/node-liblzma/commit/8aea7ac))
27
+ - point demo Vite alias to browser entry (fixes docs build) ([e86dba5](https://github.com/oorabona/node-liblzma/commit/e86dba5))
28
+
29
+ ### Changed
30
+ - finalize WIN32-TOCTOU-2026-04-29 — promote spec, mark TODO done ([1ee9db4](https://github.com/oorabona/node-liblzma/commit/1ee9db4))
31
+ - node-tar is pure JS and explicitly does NOT protect Windows ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
32
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
33
+ - 155 pass / 0 fail / 3 pre-existing skips. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
34
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
35
+ - 155 pass / 0 fail / 3 pre-existing skips (identical to pre-fix). ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
36
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
37
+ - round 1 = 6 findings (3 M + 2 L + 1 misclassified), round 2 ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
38
+ - 155 pass / 0 fail / 3 pre-existing skips. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
39
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
40
+ - round 1 = 6 findings, round 2 = 3, round 3 = 1, round 4 ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
41
+ - 155 pass / 0 fail / 3 pre-existing skips. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
42
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
43
+ - round 1=6, round 2=3, round 3=1, round 4=3 (2 real Ms in ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
44
+ - 155 pass / 0 fail / 3 pre-existing skips. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
45
+ - 0 errors. Type-check: 0 errors. ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
46
+ - round 1=6, round 2=3, round 3=1, round 4=3 (2 real Ms ([b24040d](https://github.com/oorabona/node-liblzma/commit/b24040d))
47
+ - refresh lockfile for latest transitive dependencies (deps) ([06e9590](https://github.com/oorabona/node-liblzma/commit/06e9590))
48
+ - finally swallows cleanup errors on consumer-break, ([06a9937](https://github.com/oorabona/node-liblzma/commit/06a9937))
49
+ - 150+3-skip pass; memory 3+1-skip pass. tsc + lint + build green. ([06a9937](https://github.com/oorabona/node-liblzma/commit/06a9937))
50
+ - refresh lockfile for latest transitive dependencies (deps) ([f8f21d0](https://github.com/oorabona/node-liblzma/commit/f8f21d0))
51
+ - - release-it (existing release.yml + .release-it.json) is retained for ([adfbc99](https://github.com/oorabona/node-liblzma/commit/adfbc99))
52
+ - capture tar-xz v6 redesign in CHANGELOGs + TODO.md ([9abd0a2](https://github.com/oorabona/node-liblzma/commit/9abd0a2))
53
+ - test fails on revert, passes on fix. ([b2c8a8c](https://github.com/oorabona/node-liblzma/commit/b2c8a8c))
54
+ - release v5.0.1 (tar-xz) ([0c631f5](https://github.com/oorabona/node-liblzma/commit/0c631f5))
55
+ - sync workspace package versions to npm registry (3.2.0 -> 5.0.0) ([900a055](https://github.com/oorabona/node-liblzma/commit/900a055))
56
+ - refresh lockfile for latest transitive dependencies (deps) ([8345c25](https://github.com/oorabona/node-liblzma/commit/8345c25))
57
+ - propagate anti-flake cleanup pattern to 3 high-risk integration tests ([f752664](https://github.com/oorabona/node-liblzma/commit/f752664))
58
+ - add afterEach cleanup + timer tracking in error_recovery test (anti-flake) ([2d7f285](https://github.com/oorabona/node-liblzma/commit/2d7f285))
59
+ - refresh lockfile for latest transitive dependencies (deps) ([bc7e804](https://github.com/oorabona/node-liblzma/commit/bc7e804))
60
+ - refresh lockfile for latest transitive dependencies (deps) ([dedd2c1](https://github.com/oorabona/node-liblzma/commit/dedd2c1))
61
+ - bump @vitest/ui (#106) (deps-dev) ([276f0b4](https://github.com/oorabona/node-liblzma/commit/276f0b4))
62
+ - refresh lockfile for latest transitive dependencies (deps) ([8b7b5b9](https://github.com/oorabona/node-liblzma/commit/8b7b5b9))
63
+ - ignore pnpm/action-setup v6+ in Dependabot (corrupts lockfile) (ci) ([fd2cf8c](https://github.com/oorabona/node-liblzma/commit/fd2cf8c))
64
+ - refresh lockfile for latest transitive dependencies (deps) ([a01694e](https://github.com/oorabona/node-liblzma/commit/a01694e))
65
+ - refresh lockfile for latest transitive dependencies (deps) ([e2eca27](https://github.com/oorabona/node-liblzma/commit/e2eca27))
66
+ - refresh lockfile for latest transitive dependencies (deps) ([b1386e9](https://github.com/oorabona/node-liblzma/commit/b1386e9))
67
+ - refresh lockfile for latest transitive dependencies (deps) ([1ba850e](https://github.com/oorabona/node-liblzma/commit/1ba850e))
68
+ - refresh lockfile for latest transitive dependencies (deps) ([e66f8fb](https://github.com/oorabona/node-liblzma/commit/e66f8fb))
69
+ - refresh lockfile for latest transitive dependencies (deps) ([fd906d6](https://github.com/oorabona/node-liblzma/commit/fd906d6))
70
+ - refresh lockfile for latest transitive dependencies (deps) ([e085fa4](https://github.com/oorabona/node-liblzma/commit/e085fa4))
71
+ - bump @vitest/ui in the dev-dependencies group (#95) (deps-dev) ([01e828c](https://github.com/oorabona/node-liblzma/commit/01e828c))
72
+ - refresh lockfile for latest transitive dependencies (deps) ([cfe60ca](https://github.com/oorabona/node-liblzma/commit/cfe60ca))
73
+ - refresh lockfile for latest transitive dependencies (deps) ([1d0dd42](https://github.com/oorabona/node-liblzma/commit/1d0dd42))
74
+ - refresh lockfile for latest transitive dependencies (deps) ([775ed0f](https://github.com/oorabona/node-liblzma/commit/775ed0f))
75
+ - refresh lockfile for latest transitive dependencies (deps) ([9a66903](https://github.com/oorabona/node-liblzma/commit/9a66903))
76
+ - refresh lockfile for latest transitive dependencies (deps) ([3e2bd44](https://github.com/oorabona/node-liblzma/commit/3e2bd44))
77
+ - refresh lockfile for latest transitive dependencies (deps) ([d3bea99](https://github.com/oorabona/node-liblzma/commit/d3bea99))
78
+
79
+ ### Removed
80
+ - - extractToMemory() — replaced by extract() + entry.bytes() ([b2c8a8c](https://github.com/oorabona/node-liblzma/commit/b2c8a8c))
81
+
82
+ ## 6.0.0
83
+
84
+ ### Major Changes
85
+
86
+ Complete API redesign. Universal stream-first design — same signatures in Node and Browser, built around `AsyncIterable<Uint8Array>`.
87
+
88
+ #### New API
89
+
90
+ - **Universal `create()`, `extract()`, `list()`** — identical signatures across Node and Browser.
91
+ - **`tar-xz/file` subpath export** (Node only) — opt-in path-based helpers `createFile()`, `extractFile()`, `listFile()`. Keeps the core SRP-clean (no fs deps in the core).
92
+ - **`AsyncIterable<TarEntryWithData>`** from `extract()` — entries yielded lazily; each carries a streaming `data` AsyncIterable plus `bytes()` and `text()` collector helpers.
93
+ - **`TarInput` union type** — accepts `AsyncIterable<Uint8Array>`, `Iterable<Uint8Array>`, `Uint8Array`, `ArrayBuffer`, `ReadableStream<Uint8Array>` (Web), or `NodeJS.ReadableStream`.
94
+
95
+ #### Security hardening
96
+
97
+ Comprehensive symlink/path TOCTOU hardening (18 vectors audited and closed in a single consolidated commit, after 7 rounds of Copilot review):
98
+
99
+ - Leaf symlink check (`target` itself, not just ancestors).
100
+ - Ancestor symlink walk extended to FILE/DIRECTORY/SYMLINK/HARDLINK.
101
+ - ENOENT correctly continues the ancestor walk instead of stopping.
102
+ - Hardlink `linkSource` validated for symlink-leaf and symlink-ancestor.
103
+ - `strip` option applied to both `name` and `linkname`.
104
+ - Empty / NUL-bearing names and linknames rejected.
105
+ - Dot-segment placeholder names (`.`, `./`, `..`) rejected.
106
+ - Setuid/setgid/sticky bits stripped from extracted modes by default (mirrors GNU tar `--no-same-permissions`).
107
+ - File extraction uses `fs.open(O_NOFOLLOW)` + fd-based `chmod`/`utimes` on POSIX — eliminates by-path TOCTOU window for permissions/timestamps.
108
+ - `pipeline()` instead of `pipe()` so source errors propagate properly.
109
+ - Threat-model documentation: concurrent attacker process is explicitly out of scope (POSIX `openat2(RESOLVE_BENEATH)` not exposed by Node).
110
+
111
+ #### Removed
112
+
113
+ - `extractToMemory()` — replaced by `extract()` + `entry.bytes()`.
114
+ - `createTarXz()` / `extractTarXz()` / `listTarXz()` (browser-prefixed names) — replaced by unified `create()` / `extract()` / `list()`.
115
+ - `BrowserCreateOptions` / `BrowserExtractOptions` — unified into single `CreateOptions` / `ExtractOptions`.
116
+ - `ExtractedFile` — replaced by `TarEntryWithData`.
117
+
118
+ #### Changed
119
+
120
+ - Source files for `create()` use the new `TarSourceFile` shape: `{ name, source, mode?, mtime?, linkname? }`. `source` accepts `AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer | string` (string is a Node-only fs path).
121
+ - `TarPack` / `TarUnpack` Transform classes are now internal; not exported from the package root.
122
+ - Default compression preset is uniform: `6` (Node and Browser).
123
+
124
+ #### Migration v5 → v6
125
+
126
+ See [README.md § Migration v5 → v6](./README.md#migration-v5--v6) for full code examples.
127
+
128
+ ## 5.0.1
129
+
130
+ ### Patch Changes
131
+
132
+ - Workspace package versions synchronized to npm registry (3.2.0 → 5.0.0). Internal infrastructure updates (CI workflows, lockfile maintenance, anti-flake test cleanup). No API changes.
133
+
134
+ [Unreleased]: https://github.com/oorabona/node-liblzma/compare/v6.1.0...HEAD
135
+ [v6.1.0]: https://github.com/oorabona/node-liblzma/releases/tag/v6.1.0
136
+ [6.1.0]: https://github.com/oorabona/node-liblzma/releases/tag/v6.1.0