Skip to main content

Getting Started

react-native-nitro-unzip provides high-performance ZIP extraction and compression for React Native, powered by Nitro Modules.

Requirements

RequirementVersion
React Native0.75+
Nitro Modules0.34+
iOS15.5+
Android SDK21+
Java (Android)17
New Architecture Required

This library requires React Native's New Architecture (Fabric + TurboModules) as it is built on Nitro Modules.

Installation

npm install react-native-nitro-unzip react-native-nitro-modules

iOS

cd ios && pod install

The underlying SSZipArchive dependency requires iOS 15.5+. Set your deployment target accordingly:

  • Bare React Native: in ios/Podfile, set platform :ios, '15.5'.
  • Expo: in ios/Podfile.properties.json, add "ios.deploymentTarget": "15.5" (or use the expo-build-properties plugin with ios.deploymentTarget: "15.5").

Android

No additional setup needed — the library auto-links with React Native. Your app must be built with Java 17 (the RN 0.73+ default).

Quick Start

import { getUnzip } from 'react-native-nitro-unzip';

// Create an Unzip instance
const unzip = getUnzip();

// Extract a ZIP archive
const task = unzip.extract('/path/to/archive.zip', '/path/to/output');

task.onProgress((p) => {
console.log(`${(p.progress * 100).toFixed(0)}% — ${p.extractedFiles}/${p.totalFiles} files`);
});

const result = await task.await();
console.log(`Extracted ${result.extractedFiles} files in ${result.duration}ms`);

The getUnzip() function creates an Unzip factory instance. From there you can create extraction tasks, compression tasks, and more. Each task is an independent, observable, and cancellable operation.

Next Steps