open-index/open-npm huggingface dataset:
npm package: @javascriptcommon/react-native-xz
Description: Native XZ/LZMA2 decompression for React Native (TurboModules)
Author: Aspect Apps
Latest version: 1.1.2

# react-native-xz

Native XZ/LZMA2 decompression for React Native. Provides fast, efficient decompression of `.xz` files using native libraries on both iOS and Android.

## Features

- Native XZ/LZMA2 decompression
- Decompress files to disk or directly to string
- iOS: Uses [SWCompression](https://github.com/tsolomko/SWCompression)
- Android: Uses [XZ for Java](https://tukaani.org/xz/java.html)
- Supports React Native 0.72+

## Installation

```bash
npm install @javascriptcommon/react-native-xz
# or
yarn add @javascriptcommon/react-native-xz
```

### iOS

```bash
cd ios && pod install
```

### Android

No additional setup required.

## Usage

```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');
```

## API

### `decompressFile(inputPath: string, outputPath: string): Promise<string>`

Decompresses an XZ file to a destination path.

- `inputPath`: Path to the `.xz` compressed file
- `outputPath`: Path where decompressed file will be written
- Returns: Promise resolving to the output path

### `decompressToString(inputPath: string): Promise<string>`

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

## Requirements

- React Native >= 0.72.0
- iOS >= 13.0
- Android minSdk >= 21

## License

MIT