{"id":19651718,"url":"https://github.com/tanaikech/zipfolder","last_synced_at":"2025-07-16T23:36:42.384Z","repository":{"id":49758433,"uuid":"110411592","full_name":"tanaikech/ZipFolder","owner":"tanaikech","description":"This is a library for zipping a folder using Google Apps Scripts.","archived":false,"fork":false,"pushed_at":"2019-10-15T05:29:26.000Z","size":5,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-28T16:49:48.738Z","etag":null,"topics":["developer-tools","gas-library","google-apps-script","library"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tanaikech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-12T06:49:13.000Z","updated_at":"2024-12-14T16:58:21.000Z","dependencies_parsed_at":"2022-09-24T05:51:40.950Z","dependency_job_id":null,"html_url":"https://github.com/tanaikech/ZipFolder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tanaikech/ZipFolder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FZipFolder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FZipFolder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FZipFolder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FZipFolder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanaikech","download_url":"https://codeload.github.com/tanaikech/ZipFolder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FZipFolder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265550492,"owners_count":23786579,"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":["developer-tools","gas-library","google-apps-script","library"],"created_at":"2024-11-11T15:07:41.475Z","updated_at":"2025-07-16T23:36:42.363Z","avatar_url":"https://github.com/tanaikech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZipFolder\r\n\r\n\u003ca name=\"top\"\u003e\u003c/a\u003e\r\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENCE)\r\n\r\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\r\n\r\n# Overview\r\n\r\nThis is a library for zipping a folder using Google Apps Scripts.\r\n\r\n\u003ca name=\"description\"\u003e\u003c/a\u003e\r\n\r\n# Description\r\n\r\nWhen users manually download a folder on Google Drive, users can download all files in the folder as a zip file using the web interface. [There are zip tools in Class Utilities of Google Apps Script](https://developers.google.com/apps-script/reference/utilities/utilities). However, the zip tools cannot create a zip file from a folder. And it cannot retrieve all files included any folders in a folder. So I created this. This library works like almost the same to the web interface using GAS.\r\n\r\n## Feature\r\n\r\n- Retrieve all files in a folder. If there are folders in the folder, this library retrieves all files in all folders.\r\n- Google Docs of Spreadsheet, Document and Slide which are included in the folder are converted to Excel, Word and Powerpoint format, respectively.\r\n- Standalone scripts (projects) which are included in the folder are converted to JSON.\r\n- Other types (images, text data and so on) are not converted.\r\n- Google Form is not retrieved. Because it cannot be converted to export.\r\n\r\n# Library's project key\r\n\r\n```\r\n1q5FY5UxNpFNYxtd-LZgIjchicKq1BfDCVPbOwA0BDiL6zfCTxjfe-Puz\r\n```\r\n\r\n# How to install\r\n\r\n- [Install ManifestsApp library](https://developers.google.com/apps-script/guides/libraries).\r\n  - Library's project key is **`1q5FY5UxNpFNYxtd-LZgIjchicKq1BfDCVPbOwA0BDiL6zfCTxjfe-Puz`**\r\n\r\nInstalling is done. You can use ZipFolder.\r\n\r\n# Usage\r\n\r\n```javascript\r\nvar blob = ZipFolder.zip(folderId);\r\nDriveApp.createFile(blob);\r\n```\r\n\r\nor\r\n\r\n```javascript\r\nvar blob = ZipFolder.zip(folderId, \"_\");\r\nDriveApp.createFile(blob);\r\n```\r\n\r\n`\"_\"` is a delimiter between folder names. You can use freely various delimiters. If this is given, folder tree is used as a prefix of filename when there are folders in the folderId. If this is not given, the prefix is not used. For example, when there is `/folder1/folder2/folder3/file1`. When `var blob = ZipFolder.zip(### ID of folder1 ###, \"_\")` is used, filename will be `folder2_folder3_file1`. `folder1` is used as the filename of zip file.\r\n\r\nYou can also see the documents at the following URL.\r\n\r\n[https://script.google.com/macros/library/versions/d/1q5FY5UxNpFNYxtd-LZgIjchicKq1BfDCVPbOwA0BDiL6zfCTxjfe-Puz](https://script.google.com/macros/library/versions/d/1q5FY5UxNpFNYxtd-LZgIjchicKq1BfDCVPbOwA0BDiL6zfCTxjfe-Puz)\r\n\r\n\u003ca name=\"option1\"\u003e\u003c/a\u003e\r\n\r\n# Option for preventing the duplicated filenames when the Google Docs is converted\r\n\r\n```javascript\r\nvar blob = ZipFolder.zip(folderId, null, { noExtension: true });\r\nDriveApp.createFile(blob);\r\n```\r\n\r\nor\r\n\r\n```javascript\r\nvar blob = ZipFolder.zip(folderId, \"_\", { noExtension: true });\r\nDriveApp.createFile(blob);\r\n```\r\n\r\nIn this case, the files converted from Google Docs to Microsoft Docs have no extension of the filename. Please be careful this.\r\n\r\n# For your applications\r\n\r\nFor example, by deploying as Web Apps, this can be used as an API for zipping folders.\r\n\r\n\u003ca name=\"licence\"\u003e\u003c/a\u003e\r\n\r\n# Licence\r\n\r\n[MIT](LICENCE)\r\n\r\n\u003ca name=\"author\"\u003e\u003c/a\u003e\r\n\r\n# Author\r\n\r\n[Tanaike](https://tanaikech.github.io/about/)\r\n\r\nIf you have any questions and commissions for me, feel free to tell me.\r\n\r\n\u003ca name=\"updatehistory\"\u003e\u003c/a\u003e\r\n\r\n# Update History\r\n\r\n- v1.0.0 (November 12, 2017)\r\n\r\n  Initial release.\r\n\r\n- v1.0.1 (October 15, 2019)\r\n\r\n  - [The option for preventing the duplicated filenames when the Google Docs is converted was added.](#option1)\r\n\r\n[TOP](#top)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fzipfolder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanaikech%2Fzipfolder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fzipfolder/lists"}