{"id":15103990,"url":"https://github.com/ellraiser/love-zip","last_synced_at":"2026-01-18T19:07:32.356Z","repository":{"id":211113597,"uuid":"728242167","full_name":"ellraiser/love-zip","owner":"ellraiser","description":"zero-dependency ZIP file compressor/decompressor for LÖVE","archived":false,"fork":false,"pushed_at":"2023-12-14T20:42:20.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T23:51:21.529Z","etag":null,"topics":["love2d","lua","unzip","zip"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/ellraiser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-12-06T14:27:54.000Z","updated_at":"2025-02-04T00:35:13.000Z","dependencies_parsed_at":"2023-12-14T21:34:01.966Z","dependency_job_id":null,"html_url":"https://github.com/ellraiser/love-zip","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"b80c930c836cddeff05a1696c605740f2e1c0c1b"},"previous_names":["ellraiser/love-zip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellraiser%2Flove-zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellraiser%2Flove-zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellraiser%2Flove-zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellraiser%2Flove-zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ellraiser","download_url":"https://codeload.github.com/ellraiser/love-zip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247335925,"owners_count":20922534,"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":["love2d","lua","unzip","zip"],"created_at":"2024-09-25T20:00:21.136Z","updated_at":"2026-01-18T19:07:32.350Z","avatar_url":"https://github.com/ellraiser.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# löve-zip  \nZero-dependency ZIP file compressor/decompressor module for use with [LÖVE](https://github.com/love2d/love).\n\nThere were a couple existing Lua options but I was yet to find any that could support compressing/decompressing symlinks on Windows correctly without either making empty symlink files or duplicating the content, or without wiping the last modified date/time when decompressed by the OS.\n\n\u003e This module is built to work with versions `11.X` and `12.X`\n\n---\n\n## Usage\nSimply require the module in your game, some usage examples are shown below. See the API section further down for more details on each method. You can also run the `main.lua` file with LÖVE to see some basic examples in action.\n\nAs this module uses the LÖVE filesystem, your file paths should be relative to [save directory](https://love2d.org/wiki/love.filesystem.getSaveDirectory) or your project path as they are passed directly to `love.filesystem.x`.\n\n```lua\n-- load the module\nrequire('love-zip')\n\n-- decompress an existing zip\nlocal unzip = love.zip:newZip()\nlocal decompress, err = unzip:decompress('path/to/my/file.zip', 'path/to/output/')\nassert(decompress == true)\n\n-- compress an existing folder to a zip\nlocal zip = love.zip:newZip()\nlocal compress, err = zip:compress('path/to/compress/', 'path/to/output/file.zip')\nassert(compress == true)\n\n-- compress while ignoring a list of folders/files\nlocal zip = love.zip:newZip()\nlocal compress, err = zip:compress('path/to/compress/', 'path/to/output/file.zip', {'.DS_Store', 'dist', '.gitignore'})\nassert(compress == true)\n\n-- compress specific files/folders manually\nlocal zip = love.zip:newZip()\nzip:addFile('path/to/file.txt', 'file.txt') -- single file \nzip:addFolder('file/to/directory') -- specific directory contents\nzip:addFolder('file/to/other/directory', {'ignore.txt'}) -- directory contents with ignore list\nlocal compress, err = zip:finish('path/to/final.zip')\nassert(compress == true)\n```\n\n---\n\n## Notes\nThe module uses `os.execute()` to mark binary files as executable when decompressing if needed, as well as to resolve and create symlinks, if any.\n\nOn Windows, `mklink` is used when decompressing UNIX symlinks to recreate the link, this means you will need to run the program as an administrator or you'll see the following error:  \n\u003e You do not have sufficient privilege to perform this operation.\n\n---\n\n## API\n\n### love.zip:newZip(verbose_logs)\nCreates a new Zip instance to work with.  \n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| verbose_logs     | boolean  | output more detailed logs when compressing/decompressing |\n\nReturns a new `Zip` object to use with the methods below\n\n### Zip:decompress(zip_file, output_folder)\nDecompresses a given zip file to a given output folder.  \n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| zip_file         | string   | relative path of the zip file from the LÖVE $SAVE_DIRECTORY |\n| output_folder    | string   | output folder for zip contents |\n\nReturns two values, the first is a `boolean` of whether the method suceeded, the second is an error `string` if an error occured.  \n\n### Zip:compress(target_folder, output_zip, ignore_list)\nCompresses an existing folder into a new zip file.  \n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| target_folder    | string   | target folder relative to the LÖVE $SAVE_DIRECTORY |\n| output_zip       | string   | output path and filename for the zip |\n| ignore_list      | table    | list of strings containing files/folders to ignore when zipping |\n\nReturns two values, the first is a `boolean` of whether the method suceeded, the second is an error `string` if an error occured\n\n\u003e If you want more control you can use the following methods to directly add specific files and folders  \n\u003e You will need to use `Zip:finish()` when done to commit the added data to disk\n\n### Zip:addFile(target_file, file_path)\nAdds a specific file to the zip instance ready to be written.  \n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| target_file      | string   | target file to add relative to the LÖVE $SAVE_DIRECTORY |\n| file_path        | string   | path of the file to use inside the zip folder |\n\nReturns two values, the first is a `boolean` of whether the method suceeded, the second is an error `string` if an error occured\n\n### Zip:addFolder(target_folder, ignore_list)\nAdds the contents of a given folder to the zip instance ready to be written.   \n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| target_folder    | string   | target folder relative to the LÖVE $SAVE_DIRECTORY |\n| ignore_list      | table    | list of strings containing files/folders to ignore when zipping |\n\nReturns two values, the first is a `boolean` of whether the method suceeded, the second is an error `string` if an error occured\n\n### Zip:finish(output_zip)\nCommits all data added via `addFile` and `addFolder` and writes the final zip\n| Parameter        | Datatype | Description |\n| ---------------- | -------  | ----------- | \n| output_zip       | string   | output path and filename for the zip |\n\nReturns two values, the first is a `boolean` of whether the method suceeded, the second is an error `string` if an error occured\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellraiser%2Flove-zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fellraiser%2Flove-zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellraiser%2Flove-zip/lists"}