react-native-nitro-unzip 0.2.2 → 0.2.3
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,13 +1,16 @@
|
|
|
1
1
|
# react-native-nitro-unzip
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/react-native-nitro-unzip)
|
|
4
|
+
[](https://www.npmjs.com/package/react-native-nitro-unzip)
|
|
4
5
|
[](https://github.com/isaacrowntree/react-native-nitro-unzip/blob/main/LICENSE)
|
|
5
6
|
[](https://github.com/isaacrowntree/react-native-nitro-unzip/actions/workflows/lint-typescript.yml)
|
|
7
|
+

|
|
8
|
+

|
|
6
9
|
|
|
7
10
|
High-performance ZIP operations for React Native, powered by [Nitro Modules](https://nitro.margelo.com/).
|
|
8
11
|
|
|
9
|
-
- **iOS**: SSZipArchive (C-based libz) — ~500 files/sec
|
|
10
|
-
- **Android**: Optimized ZipInputStream
|
|
12
|
+
- **iOS**: [SSZipArchive](https://github.com/ZipArchive/ZipArchive) (C-based libz) — ~500 files/sec
|
|
13
|
+
- **Android**: Optimized ZipInputStream + [zip4j](https://github.com/srikanth-lingala/zip4j) for encryption — ~474 files/sec
|
|
11
14
|
- **Zero bridge overhead** — progress callbacks via JSI, no serialization
|
|
12
15
|
- **Object instances** — each task is an observable, cancellable `UnzipTask` or `ZipTask`
|
|
13
16
|
- **Concurrent operations** supported out of the box
|
|
@@ -15,6 +18,18 @@ High-performance ZIP operations for React Native, powered by [Nitro Modules](htt
|
|
|
15
18
|
- **Zip creation** — compress files and directories with optional password protection
|
|
16
19
|
- **Background tasks** — iOS background task management for continued extraction
|
|
17
20
|
|
|
21
|
+
### vs react-native-zip-archive
|
|
22
|
+
|
|
23
|
+
| | react-native-nitro-unzip | react-native-zip-archive |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| Architecture | JSI (Nitro Modules) | Bridge |
|
|
26
|
+
| Progress callbacks | Via JSI, no serialization | Via bridge events |
|
|
27
|
+
| Cancellation | Synchronous | Not supported |
|
|
28
|
+
| Concurrent ops | Yes | Limited |
|
|
29
|
+
| Password support | AES-256 (zip & unzip) | Unzip only |
|
|
30
|
+
| Zip creation | Yes | Yes |
|
|
31
|
+
| New Architecture | Required | Optional |
|
|
32
|
+
|
|
18
33
|
## Installation
|
|
19
34
|
|
|
20
35
|
```bash
|
package/nitro.json
CHANGED
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"Unzip": {
|
|
13
13
|
"swift": "HybridUnzip",
|
|
14
14
|
"kotlin": "HybridUnzip"
|
|
15
|
-
},
|
|
16
|
-
"UnzipTask": {
|
|
17
|
-
"swift": "HybridUnzipTask",
|
|
18
|
-
"kotlin": "HybridUnzipTask"
|
|
19
|
-
},
|
|
20
|
-
"ZipTask": {
|
|
21
|
-
"swift": "HybridZipTask",
|
|
22
|
-
"kotlin": "HybridZipTask"
|
|
23
15
|
}
|
|
24
16
|
},
|
|
25
17
|
"ignorePaths": ["node_modules", "lib", "example"]
|
|
@@ -50,22 +50,6 @@ void registerAllNatives() {
|
|
|
50
50
|
return instance->cthis()->shared();
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
54
|
-
"UnzipTask",
|
|
55
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
56
|
-
static DefaultConstructableObject<JHybridUnzipTaskSpec::javaobject> object("com/margelo/nitro/unzip/HybridUnzipTask");
|
|
57
|
-
auto instance = object.create();
|
|
58
|
-
return instance->cthis()->shared();
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
62
|
-
"ZipTask",
|
|
63
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
64
|
-
static DefaultConstructableObject<JHybridZipTaskSpec::javaobject> object("com/margelo/nitro/unzip/HybridZipTask");
|
|
65
|
-
auto instance = object.create();
|
|
66
|
-
return instance->cthis()->shared();
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
53
|
}
|
|
70
54
|
|
|
71
55
|
} // namespace margelo::nitro::unzip
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
#import <type_traits>
|
|
12
12
|
|
|
13
13
|
#include "HybridUnzipSpecSwift.hpp"
|
|
14
|
-
#include "HybridUnzipTaskSpecSwift.hpp"
|
|
15
|
-
#include "HybridZipTaskSpecSwift.hpp"
|
|
16
14
|
|
|
17
15
|
@interface NitroUnzipAutolinking : NSObject
|
|
18
16
|
@end
|
|
@@ -30,20 +28,6 @@
|
|
|
30
28
|
return hybridObject;
|
|
31
29
|
}
|
|
32
30
|
);
|
|
33
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
34
|
-
"UnzipTask",
|
|
35
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
36
|
-
std::shared_ptr<HybridUnzipTaskSpec> hybridObject = NitroUnzip::NitroUnzipAutolinking::createUnzipTask();
|
|
37
|
-
return hybridObject;
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
41
|
-
"ZipTask",
|
|
42
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
43
|
-
std::shared_ptr<HybridZipTaskSpec> hybridObject = NitroUnzip::NitroUnzipAutolinking::createZipTask();
|
|
44
|
-
return hybridObject;
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
31
|
}
|
|
48
32
|
|
|
49
33
|
@end
|
|
@@ -23,28 +23,4 @@ public final class NitroUnzipAutolinking {
|
|
|
23
23
|
public static func isUnzipRecyclable() -> Bool {
|
|
24
24
|
return HybridUnzip.self is any RecyclableView.Type
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
public static func createUnzipTask() -> bridge.std__shared_ptr_HybridUnzipTaskSpec_ {
|
|
28
|
-
let hybridObject = HybridUnzipTask()
|
|
29
|
-
return { () -> bridge.std__shared_ptr_HybridUnzipTaskSpec_ in
|
|
30
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
31
|
-
return __cxxWrapped.getCxxPart()
|
|
32
|
-
}()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public static func isUnzipTaskRecyclable() -> Bool {
|
|
36
|
-
return HybridUnzipTask.self is any RecyclableView.Type
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public static func createZipTask() -> bridge.std__shared_ptr_HybridZipTaskSpec_ {
|
|
40
|
-
let hybridObject = HybridZipTask()
|
|
41
|
-
return { () -> bridge.std__shared_ptr_HybridZipTaskSpec_ in
|
|
42
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
43
|
-
return __cxxWrapped.getCxxPart()
|
|
44
|
-
}()
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public static func isZipTaskRecyclable() -> Bool {
|
|
48
|
-
return HybridZipTask.self is any RecyclableView.Type
|
|
49
|
-
}
|
|
50
26
|
}
|
package/package.json
CHANGED