{"id":48256483,"url":"https://github.com/alexandre-garrec/react-native-zip-stream","last_synced_at":"2026-04-04T21:13:49.388Z","repository":{"id":254495112,"uuid":"846687478","full_name":"alexandre-garrec/react-native-zip-stream","owner":"alexandre-garrec","description":"React Native module for streaming files from ZIP archives.","archived":false,"fork":false,"pushed_at":"2025-01-10T20:50:16.000Z","size":1814,"stargazers_count":10,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T21:42:07.527Z","etag":null,"topics":["react-native","streaming","zip"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexandre-garrec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-23T18:30:17.000Z","updated_at":"2025-01-10T20:50:19.000Z","dependencies_parsed_at":"2025-01-10T21:42:17.660Z","dependency_job_id":"067b9a3c-f551-4c75-b5e6-c9c75e7e2a4a","html_url":"https://github.com/alexandre-garrec/react-native-zip-stream","commit_stats":null,"previous_names":["agarrec-vivlio/react-native-zip-stream","alexandre-garrec/react-native-zip-stream"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/alexandre-garrec/react-native-zip-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandre-garrec%2Freact-native-zip-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandre-garrec%2Freact-native-zip-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandre-garrec%2Freact-native-zip-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandre-garrec%2Freact-native-zip-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandre-garrec","download_url":"https://codeload.github.com/alexandre-garrec/react-native-zip-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandre-garrec%2Freact-native-zip-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31414474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-native","streaming","zip"],"created_at":"2026-04-04T21:13:49.312Z","updated_at":"2026-04-04T21:13:49.378Z","avatar_url":"https://github.com/alexandre-garrec.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-zip-stream\n\n[![npm](https://img.shields.io/npm/v/react-native-zip-stream.svg?style=flat-square)](https://www.npmjs.com/package/react-native-zip-stream)\n\nA React Native module for working with ZIP archives. This module allows you to list the contents of ZIP files, stream files from ZIP archives, create new ZIP files. Now supports password-protected ZIPs.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [List Zip Contents](#list-zip-contents)\n  - [Stream File from Zip](#stream-file-from-zip)\n  - [Unzip File](#unzip-file)\n  - [Create Zip File](#create-zip-file)\n- [API Reference](#api-reference)\n  - [listZipContents](#listzipcontents)\n  - [streamFileFromZip](#streamfilefromzip)\n  - [unzipFile](#unzipfile)\n  - [createZipFile](#createzipfile)\n- [Examples](#examples)\n  - [List Zip Contents Example](#list-zip-contents-example)\n  - [Stream File from Zip Example](#stream-file-from-zip-example)\n  - [Unzip File Example](#unzip-file-example)\n  - [Create Zip File Example](#create-zip-file-example)\n\n## Installation\n\nTo install the module, follow these steps:\n\n1. Add the dependency to your project:\n\n   ```bash\n   npm install react-native-zip-stream\n   ```\n\n2. For iOS, install the required CocoaPods dependencies:\n\n   ```bash\n   cd ios\n   pod install\n   ```\n\n\n## Usage\n\n### List Zip Contents\n\nLists the contents of a ZIP file. This function returns an array of file names contained within the ZIP archive.\n\n### Stream File from Zip\n\nStreams a specific file from a ZIP archive. You can retrieve the file data in one of three formats: `base64`, `arraybuffer`, or `string`. Now supports password-protected ZIPs.\n\n### Unzip File\n\nExtracts all the contents of a ZIP file to a specified destination directory. Now supports password-protected ZIPs.\n\n### Create Zip File\n\nCreates a new ZIP file from the contents of a specified directory.\n\n## API Reference\n\n### listZipContents\n\nLists the contents of a ZIP file.\n\n#### Parameters\n\n- `zipFilePath`: `string` - The full path to the ZIP file.\n\n#### Returns\n\n- `Promise\u003cstring[]\u003e` - A promise that resolves to an array of file names inside the ZIP file.\n\n### streamFileFromZip\n\nStreams a specific file from the ZIP archive, with optional password support.\n\n#### Parameters\n\n- `zipFilePath`: `string` - The full path to the ZIP file.\n- `entryName`: `string` - The name of the file within the ZIP archive to extract.\n- `type`: `string` (optional, default: `base64`) - The format in which to return the file data. Can be `base64`, `arraybuffer`, or `string`.\n- `password`: `string` (optional) - The password for the ZIP file, if it is encrypted.\n\n#### Returns\n\n- `Promise\u003cstring | ArrayBuffer | Uint8Array\u003e` - A promise that resolves to the file content in the specified format.\n\n---\n\n### unzipFile\n\nExtracts all the contents of a password-protected ZIP file to a specified destination directory.\n\n#### Parameters\n\n- `zipFilePath`: `string` - The full path to the ZIP file.\n- `destinationPath`: `string` - The path where the contents of the ZIP file should be extracted.\n- `password`: `string` (optional) - The password for the ZIP file, if it is encrypted.\n\n#### Returns\n\n- `Promise\u003cboolean\u003e` - A promise that resolves to `true` if the operation is successful.\n\n---\n\n### createZipFile\n\nCreates a new ZIP file from the contents of a specified directory.\n\n#### Parameters\n\n- `destinationPath`: `string` - The full path where the ZIP file should be created.\n- `sourcePath`: `string` - The path to the directory or file that should be zipped.\n\n#### Returns\n\n- `Promise\u003cboolean\u003e` - A promise that resolves to `true` if the ZIP file is created successfully.\n\n## Examples\n\n### List Zip Contents Example\n\n```typescript\nimport { listZipContents } from 'react-native-zip-stream';\n\nconst zipFilePath = '/path/to/your/zipfile.zip';\n\nconst exampleListZipContents = async () =\u003e {\n  try {\n    const fileNames = await listZipContents(zipFilePath);\n    console.log('Files in ZIP:', fileNames);\n  } catch (error) {\n    console.error('Error listing ZIP contents:', error);\n  }\n};\n```\n\n### Stream File from Password-Protected Zip Example\n\n```typescript\nimport { streamFileFromZip } from 'react-native-zip-stream';\n\nconst zipFilePath = '/path/to/your/zipfile.zip';\nconst entryName = 'fileInsideZip.txt';\nconst password = 'yourPassword';\n\nconst exampleStreamFile = async () =\u003e {\n  try {\n    const base64Data = await streamFileFromZip(\n      zipFilePath,\n      entryName,\n      'base64',\n      password\n    );\n    console.log('Base64 Data:', base64Data);\n\n    const arrayBufferData = await streamFileFromZip(\n      zipFilePath,\n      entryName,\n      'arraybuffer',\n      password\n    );\n    console.log('ArrayBuffer Data:', new Uint8Array(arrayBufferData));\n\n    const stringData = await streamFileFromZip(\n      zipFilePath,\n      entryName,\n      'string',\n      password\n    );\n    console.log('String Data:', stringData);\n  } catch (error) {\n    console.error('Error streaming file:', error);\n  }\n};\n```\n\n### Unzip Password-Protected File Example\n\n```typescript\nimport { unzipFile } from 'react-native-zip-stream';\n\nconst zipFilePath = '/path/to/your/zipfile.zip';\nconst destinationPath = '/path/to/extract/';\nconst password = 'yourPassword';\n\nconst exampleUnzipFile = async () =\u003e {\n  try {\n    const success = await unzipFile(zipFilePath, destinationPath, password);\n    console.log('Unzip successful:', success);\n  } catch (error) {\n    console.error('Error unzipping file:', error);\n  }\n};\n```\n\n### Create Zip File Example\n\n```typescript\nimport { createZipFile } from 'react-native-zip-stream';\n\nconst sourcePath = '/path/to/source/folder';\nconst destinationPath = '/path/to/output.zip';\n\nconst exampleCreateZipFile = async () =\u003e {\n  try {\n    const success = await createZipFile(destinationPath, sourcePath);\n    console.log('Zip creation successful:', success);\n  } catch (error) {\n    console.error('Error creating zip file:', error);\n  }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandre-garrec%2Freact-native-zip-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandre-garrec%2Freact-native-zip-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandre-garrec%2Freact-native-zip-stream/lists"}