{"id":29189427,"url":"https://github.com/coderaiser/node-onezip","last_synced_at":"2025-07-01T23:07:42.920Z","repository":{"id":57314707,"uuid":"72549320","full_name":"coderaiser/node-onezip","owner":"coderaiser","description":"Pack and extract zip archives with emitter","archived":false,"fork":false,"pushed_at":"2024-12-05T15:08:57.000Z","size":112,"stargazers_count":7,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-17T05:19:08.947Z","etag":null,"topics":["emitter","extract","hacktoberfest","javascript","nodejs","pack","zip"],"latest_commit_sha":null,"homepage":"","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/coderaiser.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","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":"2016-11-01T15:26:46.000Z","updated_at":"2024-12-05T15:09:10.000Z","dependencies_parsed_at":"2024-02-14T20:42:10.121Z","dependency_job_id":"6d8d06d8-94fe-465b-9765-5b63a3c87f1d","html_url":"https://github.com/coderaiser/node-onezip","commit_stats":{"total_commits":175,"total_committers":4,"mean_commits":43.75,"dds":0.03428571428571425,"last_synced_commit":"b1b3c96242a511cdef95feba6bba9b0f4fbaf3c8"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/coderaiser/node-onezip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-onezip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-onezip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-onezip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-onezip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderaiser","download_url":"https://codeload.github.com/coderaiser/node-onezip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-onezip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047676,"owners_count":23405280,"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":["emitter","extract","hacktoberfest","javascript","nodejs","pack","zip"],"created_at":"2025-07-01T23:07:42.127Z","updated_at":"2025-07-01T23:07:42.897Z","avatar_url":"https://github.com/coderaiser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneZip [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]: https://npmjs.org/package/onezip \"npm\"\n[NPMIMGURL]: https://img.shields.io/npm/v/onezip.svg?style=flat\n[BuildStatusURL]: https://github.com/coderaiser/node-onezip/actions/workflows/nodejs.yml \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/coderaiser/node-onezip/actions/workflows/nodejs.yml/badge.svg\n[CoverageURL]: https://coveralls.io/github/coderaiser/node-onezip?branch=master\n[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/node-onezip/badge.svg?branch=master\u0026service=github\n\nPack and extract .zip archives with emitter.\n\n## Global\n\n`onezip` could be installed global with\n\n```\nnpm i onezip -g\n```\n\nAnd used this way:\n\n```\nUsage: onezip [filename]\nOptions:\n  -h, --help      display this help and exit\n  -v, --version   output version information and exit\n  -p, --pack      pack files to archive\n  -x, --extract   extract files from archive\n```\n\n## Local\n\n`onezip` could be used locally. It will emit event on every packed/extracted file.\nGood for making progress bars.\n\n## Install\n\n```\nnpm i onezip --save\n```\n\n## How to use?\n\n### pack(from, to, names)\n\n- `from`  - **string** directory that would be packed\n- `to`    - **string** or **stream**, name of archive\n- `names` - **array** of names in directory `from` that would be packed.\n\n```js\nconst onezip = require('onezip');\nconst path = require('node:path');\nconst cwd = process.cwd();\nconst name = 'pipe.tar.gz';\nconst from = `${cwd}/pipe-io`;\nconst to = path.join(cwd, name);\n\nconst pack = onezip.pack(from, to, ['LICENSE', 'README.md', 'package.json']);\n\npack.on('file', (name) =\u003e {\n    console.log(name);\n});\n\npack.on('start', () =\u003e {\n    console.log('start packing');\n});\n\npack.on('progress', (percent) =\u003e {\n    console.log(`${percent}%`);\n});\n\npack.on('error', (error) =\u003e {\n    console.error(error);\n});\n\npack.on('end', () =\u003e {\n    console.log('done');\n});\n```\n\n### extract(from, to)\n\n- `from` - path to **.zip** archive\n- `to` - path to directory where files would be stored.\n\n```js\nconst onezip = require('onezip');\nconst path = require('node:path');\nconst cwd = process.cwd();\nconst name = 'pipe.zip';\nconst to = `${cwd}/pipe-io`;\nconst from = path.join(cwd, name);\n\nconst extract = onezip.extract(from, to);\n\nextract.on('file', (name) =\u003e {\n    console.log(name);\n});\n\nextract.on('start', (percent) =\u003e {\n    console.log('extracting started');\n});\n\nextract.on('progress', (percent) =\u003e {\n    console.log(`${percent}%`);\n});\n\nextract.on('error', (error) =\u003e {\n    console.error(error);\n});\n\nextract.on('end', () =\u003e {\n    console.log('done');\n});\n```\n\nIn case of starting example output should be similar to (but with additional events):\n\n```\n33%\n67%\n100%\ndone\n```\n\n## Related\n\n- [Jag](https://github.com/coderaiser/node-jag \"Jag\") - Pack files and folders with tar and gzip.\n- [Jaguar](https://github.com/coderaiser/node-jaguar \"Jaguar\") - Pack and extract .tar.gz archives with emitter.\n- [Tar-to-zip](https://github.com/coderaiser/node-tar-to-zip \"Tar-to-zip\") - Convert tar and tar.gz archives to zip.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-onezip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderaiser%2Fnode-onezip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-onezip/lists"}