rar-stream 5.3.0 → 5.3.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/README.md +45 -0
- package/browser.d.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,27 @@
|
|
|
10
10
|
<a href="https://www.npmjs.com/package/rar-stream"><img alt="npm Downloads" src="https://img.shields.io/npm/dm/rar-stream?style=for-the-badge&logo=npm&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" /></a>
|
|
11
11
|
<a href="https://github.com/doom-fish/rar-stream#license"><img alt="License" src="https://img.shields.io/crates/l/rar-stream?style=for-the-badge&logo=apache&color=ee999f&logoColor=D9E0EE&labelColor=302D41" /></a>
|
|
12
12
|
<a href="https://github.com/doom-fish/rar-stream/actions"><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/doom-fish/rar-stream/ci.yml?branch=main&style=for-the-badge&logo=github&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" /></a>
|
|
13
|
+
<a href="https://codecov.io/gh/doom-fish/rar-stream"><img alt="Coverage" src="https://img.shields.io/codecov/c/github/doom-fish/rar-stream?style=for-the-badge&logo=codecov&color=F0C6C6&logoColor=D9E0EE&labelColor=302D41" /></a>
|
|
13
14
|
</p></div>
|
|
14
15
|
|
|
15
16
|
> Fast RAR archive streaming for Rust, Node.js, and browsers. Zero dependencies core.
|
|
16
17
|
|
|
18
|
+
## 📑 Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Quick Start](#quick-start)
|
|
22
|
+
- [Examples](#examples)
|
|
23
|
+
- [API](#api)
|
|
24
|
+
- [Feature Flags](#feature-flags)
|
|
25
|
+
- [Format Support](#format-support)
|
|
26
|
+
- [Performance](#performance)
|
|
27
|
+
- [Migrating from v3.x](#migrating-from-v3x)
|
|
28
|
+
- [Architecture](ARCHITECTURE.md)
|
|
29
|
+
- [Contributing](CONTRIBUTING.md)
|
|
30
|
+
- [Security](SECURITY.md)
|
|
31
|
+
- [Changelog](CHANGELOG.md)
|
|
32
|
+
- [License](#license)
|
|
33
|
+
|
|
17
34
|
## Installation
|
|
18
35
|
|
|
19
36
|
### Node.js
|
|
@@ -108,6 +125,30 @@ interface FileMedia {
|
|
|
108
125
|
| `streamToBuffer(stream)` | Convert Readable to Buffer |
|
|
109
126
|
| `createFileMedia(source)` | Wrap any `{ createReadStream }` as FileMedia |
|
|
110
127
|
|
|
128
|
+
## Feature Flags
|
|
129
|
+
|
|
130
|
+
### Rust (Cargo)
|
|
131
|
+
|
|
132
|
+
| Feature | Default | Description |
|
|
133
|
+
|---------|---------|-------------|
|
|
134
|
+
| `async` | No | Async archive reading via tokio (`RarFilesPackage`, `InnerFile`) |
|
|
135
|
+
| `crypto` | No | AES encryption (RAR4: AES-128, RAR5: AES-256) |
|
|
136
|
+
| `parallel` | No | Multi-threaded RAR5 decompression (rayon) |
|
|
137
|
+
| `napi` | No | Node.js bindings (implies `async` + `parallel`) |
|
|
138
|
+
| `wasm` | No | Browser WASM bindings |
|
|
139
|
+
|
|
140
|
+
### Platform Support
|
|
141
|
+
|
|
142
|
+
| Capability | Rust | Node.js (NAPI) | Browser (WASM) |
|
|
143
|
+
|-----------|------|----------------|----------------|
|
|
144
|
+
| Parse RAR4/RAR5 | ✅ | ✅ | ✅ |
|
|
145
|
+
| Decompress | ✅ | ✅ | ✅ |
|
|
146
|
+
| Encryption | ✅ (`crypto`) | ✅ (always on) | ✅ (`crypto`) |
|
|
147
|
+
| Async I/O | ✅ (`async`) | ✅ | — |
|
|
148
|
+
| Parallel decompress | ✅ (`parallel`) | ✅ (always on) | — |
|
|
149
|
+
| Multi-volume | ✅ | ✅ | ✅ |
|
|
150
|
+
| Streaming reads | ✅ | ✅ | — |
|
|
151
|
+
|
|
111
152
|
## Format Support
|
|
112
153
|
|
|
113
154
|
| Feature | RAR4 | RAR5 |
|
|
@@ -196,6 +237,10 @@ Ratio < 1.0 = rar-stream is faster.
|
|
|
196
237
|
|
|
197
238
|
Drop-in replacement. Same API, native Rust implementation. Requires Node.js 18+.
|
|
198
239
|
|
|
240
|
+
## Contributing
|
|
241
|
+
|
|
242
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, conventions, and the PR process.
|
|
243
|
+
|
|
199
244
|
## License
|
|
200
245
|
|
|
201
246
|
MIT
|
package/browser.d.ts
CHANGED
|
@@ -16,14 +16,14 @@ export function isRarArchive(data: Uint8Array): boolean;
|
|
|
16
16
|
/** Get RAR version (15 for RAR4, 50 for RAR5, 0 if not RAR) */
|
|
17
17
|
export function getRarVersion(data: Uint8Array): number;
|
|
18
18
|
|
|
19
|
-
/** Parse RAR header information */
|
|
19
|
+
/** Parse RAR header information (returns first file's header) */
|
|
20
20
|
export function parseRarHeader(data: Uint8Array): {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
name: string;
|
|
22
|
+
packedSize: number;
|
|
23
|
+
unpackedSize: number;
|
|
24
|
+
method: number;
|
|
25
|
+
isCompressed: boolean;
|
|
26
|
+
dataOffset: number;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/** RAR decompressor class */
|