{"id":16683879,"url":"https://github.com/meniny/zipper","last_synced_at":"2025-03-21T18:32:49.909Z","repository":{"id":56931528,"uuid":"96461377","full_name":"Meniny/Zipper","owner":"Meniny","description":"🗳A library to create, read and modify ZIP archive files, written in Swift.","archived":false,"fork":false,"pushed_at":"2023-03-27T18:43:55.000Z","size":202,"stargazers_count":40,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T03:51:26.307Z","etag":null,"topics":["archive","compression","zip"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Meniny.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"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":"2017-07-06T18:40:53.000Z","updated_at":"2023-12-05T11:22:30.000Z","dependencies_parsed_at":"2024-10-28T11:29:19.195Z","dependency_job_id":"43acef7e-673f-42a2-997c-f0b7178ea65b","html_url":"https://github.com/Meniny/Zipper","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"cd04d0aea4965dc70fb867520597401aaf0c0ef5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meniny%2FZipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meniny%2FZipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meniny%2FZipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meniny%2FZipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Meniny","download_url":"https://codeload.github.com/Meniny/Zipper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244849101,"owners_count":20520640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["archive","compression","zip"],"created_at":"2024-10-12T14:27:05.244Z","updated_at":"2025-03-21T18:32:49.591Z","avatar_url":"https://github.com/Meniny.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":":name: Zipper\n:author: Elias Abel\n:author_esc: Elias%20Abel\n:mail: admin@meniny.cn\n:desc: a Effortless ZIP Handling in Swift\n:icon: {name}.png\n:version: 1.2.0\n:na: N/A\n:ios: 9.0\n:macos: 10.11\n:watchos: 2.0\n:tvos: 9.0\n:linux: with `zlib`\n:xcode: 10.2\n:swift: 5\n:license: MIT\n:sep: %20%7C%20\n:platform: iOS{sep}macOS{sep}watchOS{sep}tvOS{sep}Linux\n= Meet `{name}`\n{author} \u003c{mail}\u003e\nv{version}, 2019-04-16\n\n[subs=\"attributes\"]\n++++\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./Assets/{icon}\" alt=\"{name}\" width=\"200px\"\u003e\n  \u003cbr/\u003e\u003cbr/\u003e\n  \u003cimg alt=\"Author\" src=\"https://img.shields.io/badge/author-{author_esc}-blue.svg\"\u003e\n  \u003cimg alt=\"EMail\" src=\"https://img.shields.io/badge/mail-{mail}-orange.svg\"\u003e\n  \u003cimg alt=\"MIT\" src=\"https://img.shields.io/badge/license-{license}-blue.svg\"\u003e\n  \u003cbr/\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-{version}-brightgreen.svg\"\u003e\n  \u003cimg alt=\"Platforms\" src=\"https://img.shields.io/badge/platform-{platform}-lightgrey.svg\"\u003e\n  \u003cimg alt=\"Swift\" src=\"https://img.shields.io/badge/swift-{swift}%2B-orange.svg\"\u003e\n  \u003cbr/\u003e\n  \u003cimg alt=\"Build Passing\" src=\"https://img.shields.io/badge/build-passing-brightgreen.svg\"\u003e\n  \u003cimg alt=\"Cocoapods\" src=\"https://img.shields.io/badge/cocoapods-compatible-brightgreen.svg\"\u003e\n  \u003cimg alt=\"Carthage\" src=\"https://img.shields.io/badge/carthage-compatible-brightgreen.svg\"\u003e\n  \u003cimg alt=\"SPM\" src=\"https://img.shields.io/badge/spm-compatible-brightgreen.svg\"\u003e\n\u003c/p\u003e\n++++\n\n:toc:\n\n== 🏵 Introduction\n\n**{name}** is {desc}.\n\n== 📋 Requirements\n\n[%header]\n|===\n2+^m|Type 1+^m|Requirement\n\n1.5+^.^|Platform ^|iOS ^|{ios}+\n^|macOS ^|{macos}\n^|tvOS ^|{tvos}\n^|watchOS ^|{watchos}\n^|Linux ^|{linux}\n\n^|IDE ^|Xcode ^| {xcode}+\n^|Language ^|Swift ^| {swift}+\n|===\n\n== 📲 Installation\n\n=== CocoaPods\n\n`{name}` is available on link:https://cocoapods.org[CocoaPods].\n\n[source, ruby, subs=\"verbatim,attributes\"]\n----\nuse_frameworks!\npod '{name}'\n----\n\n=== Manually\n\nCopy all files in the `{name}` directory into your project.\n\n== 🛌 Dependency\n\n{na}\n\n== ❤️ Contribution\n\nYou are welcome to fork and submit pull requests.\n\n== 🔖 License\n\n`{name}` is open-sourced software, licensed under the link:./LICENSE.md[`{license}`] license.\n\n== 🔫 Usage\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nimport {name}\n\nlet fileManager = FileManager()\nlet currentDirectoryURL = URL(fileURLWithPath: fileManager.currentDirectoryPath)\n----\n\n=== Zipping\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nvar archiveURL = currentDirectoryURL.appendPathComponent(\"archive.zip\")\nvar resourcesURL = currentDirectoryURL.appendPathComponent(\"directory\")\n// zip:\ndo {\n  try fileManager.zip(item: resourcesURL, to: archive)\n} catch _ {}\n// or:\nguard let archive = Zipper(url: archiveURL, accessMode: .create) else  { return }\ndo {\n  try archive.zip(item: resourcesURL)\n} catch {\n\n}\n----\n\n=== Unzipping\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nvar archiveURL = currentDirectoryURL.appendPathComponent(\"archive.zip\")\nvar destinationURL = currentDirectoryURL.appendPathComponent(\"directory\")\n// unzip:\ndo {\n  try fileManager.createDirectory(at: destinationURL, withIntermediateDirectories: true, attributes: nil)\n  try fileManager.unzip(item: archiveURL, to: destinationURL)\n} catch {\n\n}\n// or:\nguard let archive = Zipper(url: archiveURL, accessMode: .read) else  { return }\ndo {\n  try archive.unzip(to: destinationURL)\n} catch {\n\n}\n----\n\n=== Accessing individual Entries\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nvar archiveURL = currentDirectoryURL.appendPathComponent(\"archive.zip\")\nguard let archive = Zipper(url: archiveURL, accessMode: .read) else  { return }\nguard let entry = archive[\"file.txt\"] else { return }\nvar destinationURL = currentDirectoryURL.appendPathComponent(\"output.txt\")\n\ndo {\n    try archive.extract(entry, to: destinationURL)\n} catch {\n\n}\n----\n\n=== Adding/Removing Entries\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nvar archiveURL = currentDirectoryURL.appendPathComponent(\"archive.zip\")\nvar fileURL = currentDirectoryURL.appendPathComponent(\"file.ext\")\n----\n\n==== Adding:\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nguard let archive = Zipper(url: archiveURL, accessMode: .update) else { return }\ndo {\n    try archive.addEntry(with: fileURL.lastPathComponent, relativeTo: fileURL.deletingLastPathComponent())\n} catch {\n\n}\n----\n\n==== Removing:\n\n[source, swift, subs=\"verbatim,attributes\"]\n----\nguard let entry = archive[\"file.txt\"] else { return }\ndo {\n    try archive.remove(entry)\n} catch {\n\n}\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeniny%2Fzipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeniny%2Fzipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeniny%2Fzipper/lists"}