Native XZ/LZMA2 decompression for React Native (TurboModules)
npm install @javascriptcommon/react-native-xzNative XZ/LZMA2 decompression for React Native. Provides fast, efficient decompression of .xz files using native libraries on both iOS and Android.
- Native XZ/LZMA2 decompression
- Decompress files to disk or directly to string
- iOS: Uses SWCompression
- Android: Uses XZ for Java
- Supports React Native 0.72+
``bash`
npm install @javascriptcommon/react-native-xzor
yarn add @javascriptcommon/react-native-xz
`bash`
cd ios && pod install
No additional setup required.
`typescript
import { decompressFile, decompressToString } from '@javascriptcommon/react-native-xz';
// Decompress a file to another file
const outputPath = await decompressFile('/path/to/file.xz', '/path/to/output');
// Decompress a file directly to a string
const content = await decompressToString('/path/to/file.xz');
`
Decompresses an XZ file to a destination path.
- inputPath: Path to the .xz compressed fileoutputPath
- : Path where decompressed file will be written
- Returns: Promise resolving to the output path
Decompresses an XZ file and returns the contents as a UTF-8 string.
- inputPath: Path to the .xz` compressed file
- Returns: Promise resolving to the decompressed string content
- React Native >= 0.72.0
- iOS >= 13.0
- Android minSdk >= 21
MIT