{"id":14070638,"url":"https://github.com/papb/zip","last_synced_at":"2025-09-20T22:31:56.936Z","repository":{"id":57135067,"uuid":"242613126","full_name":"papb/zip","owner":"papb","description":"Zipping \u0026 unzipping, simplified.","archived":false,"fork":false,"pushed_at":"2020-08-14T02:56:03.000Z","size":896,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T15:56:01.106Z","etag":null,"topics":["archive","archiver","compress","compression","file","filesystem","folder","unzip","util","zip"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/papb.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}},"created_at":"2020-02-24T00:17:01.000Z","updated_at":"2022-09-22T17:20:40.000Z","dependencies_parsed_at":"2022-09-04T07:30:50.782Z","dependency_job_id":null,"html_url":"https://github.com/papb/zip","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papb%2Fzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papb%2Fzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papb%2Fzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papb%2Fzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/papb","download_url":"https://codeload.github.com/papb/zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233690487,"owners_count":18714782,"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","archiver","compress","compression","file","filesystem","folder","unzip","util","zip"],"created_at":"2024-08-13T07:07:58.889Z","updated_at":"2025-09-20T22:31:51.633Z","avatar_url":"https://github.com/papb.png","language":"TypeScript","readme":"# @papb/zip ![Build Status](https://github.com/papb/zip/workflows/CI/badge.svg)\n\n\u003e Zipping \u0026 unzipping, simplified.\n\n## Highlights\n\n* Written in TypeScript\n* Cross-platform\n* [Simple Promise-based API](https://github.com/papb/zip#api), for your simple zipping needs\n* No external binaries needed\n* Outputs to temporary folder if you do not specify an output path\n\n\n## Install\n\n```\n$ npm install @papb/zip\n```\n\n\n## Usage\n\n```js\nconst { zip, zipDirContents, unzip } = require('@papb/zip');\n\n(async () =\u003e {\n\tawait zip('path/to/file.txt', 'file.zip');\n\tawait zip('path/to/folder/foo123', 'foo.zip');\n\tawait zipDirContents('path/to/folder/bar', 'bar.zip');\n\tawait unzip('baz.zip', 'path/to/folder/baz');\n\n\t// If you don't specify an output path, a temp path is used:\n\tconst zipped = await zip('path/to/folder/foo');\n\tconsole.log(zipped);\n\t//=\u003e '/path/to/some/temp/folder/output.zip'\n\tconst unzipped = await unzip('foo.zip');\n\tconsole.log(unzipped);\n\t//=\u003e '/path/to/some/temp/folder' (which will contain a\n\t//   single folder called 'foo123' in this example)\n})();\n```\n\n\n## TypeScript usage\n\n@papb/zip is written in TypeScript and comes with complete type declarations. This means that you will have great code completions right in your editor, and also means that you can use it perfectly with TypeScript:\n\n```ts\nimport { zip, zipDirContents, unzip } from '@papb/zip';\n// ...\n```\n\n\n## API\n\n### zip(fileOrFolderPath, \\[destinationPath\\])\n\u003e *TypeScript signature:* `zip(fileOrFolderPath: string, destinationPath?: string): Promise\u003cstring\u003e`\n\nCreates a zip archive of the given file or folder, saving it in `destinationPath`. If `destinationPath` is not given, the zip file will be saved as `output.zip` in a freshly-created temporary folder.\n\nThis async function returns the absolute path to the generated zip file.\n\n### zipDirContents(folderPath, \\[destinationPath\\])\n\u003e *TypeScript signature:* `zipDirContents(folderPath: string, destinationPath?: string): Promise\u003cstring\u003e`\n\nCreates a zip archive of the contents of the given folder, saving it in `destinationPath`. If `destinationPath` is not given, the zip file will be saved as `output.zip` in a freshly-created temporary folder.\n\nThis async function returns the absolute path to the generated zip file.\n\n### unzip(zipFilePath, \\[destinationContainerPath\\])\n\u003e *TypeScript signature:* `unzip(zipFilePath: string, destinationContainerPath?: string): Promise\u003cstring\u003e`\n\nExtracts the zip file in `zipFilePath` into the folder specified in `destinationContainerPath`. If `destinationContainerPath` is not given, a freshly-created temporary folder will be used as container.\n\nThis async function returns the absolute path to the destination container folder.\n\n\n## License\n\nMIT © [Pedro Augusto de Paula Barbosa](https://github.com/papb)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapb%2Fzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpapb%2Fzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapb%2Fzip/lists"}