{"id":13454759,"url":"https://github.com/kevva/decompress","last_synced_at":"2025-05-15T02:07:22.571Z","repository":{"id":10225894,"uuid":"12325544","full_name":"kevva/decompress","owner":"kevva","description":"Extracting archives made easy","archived":false,"fork":false,"pushed_at":"2023-01-06T19:01:33.000Z","size":110,"stargazers_count":418,"open_issues_count":43,"forks_count":52,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-06T23:02:42.256Z","etag":null,"topics":["decompress","extract","nodejs","tar","targz","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/kevva.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":"2013-08-23T14:52:29.000Z","updated_at":"2025-04-26T15:35:30.000Z","dependencies_parsed_at":"2023-01-13T15:48:52.669Z","dependency_job_id":null,"html_url":"https://github.com/kevva/decompress","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdecompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdecompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdecompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdecompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevva","download_url":"https://codeload.github.com/kevva/decompress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259383,"owners_count":22040820,"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":["decompress","extract","nodejs","tar","targz","zip"],"created_at":"2024-07-31T08:00:57.713Z","updated_at":"2025-05-15T02:07:17.561Z","avatar_url":"https://github.com/kevva.png","language":"JavaScript","readme":"# decompress [![Build Status](https://travis-ci.org/kevva/decompress.svg?branch=master)](https://travis-ci.org/kevva/decompress)\n\n\u003e Extracting archives made easy\n\n*See [decompress-cli](https://github.com/kevva/decompress-cli) for the command-line version.*\n\n## Install\n\n```\n$ npm install decompress\n```\n\n\n## Usage\n\n```js\nconst decompress = require('decompress');\n\ndecompress('unicorn.zip', 'dist').then(files =\u003e {\n\tconsole.log('done!');\n});\n```\n\n\n## API\n\n### decompress(input, [output], [options])\n\nReturns a Promise for an array of files in the following format:\n\n```js\n{\n\tdata: Buffer,\n\tmode: Number,\n\tmtime: String,\n\tpath: String,\n\ttype: String\n}\n```\n\n#### input\n\nType: `string` `Buffer`\n\nFile to decompress.\n\n#### output\n\nType: `string`\n\nOutput directory.\n\n#### options\n\n##### filter\n\nType: `Function`\n\nFilter out files before extracting. E.g:\n\n```js\ndecompress('unicorn.zip', 'dist', {\n\tfilter: file =\u003e path.extname(file.path) !== '.exe'\n}).then(files =\u003e {\n\tconsole.log('done!');\n});\n```\n\n*Note that in the current implementation, **`filter` is only applied after fully reading all files from the archive in memory**. Do not rely on this option to limit the amount of memory used by `decompress` to the size of the files included by `filter`. `decompress` will read the entire compressed file into memory regardless.*\n\n##### map\n\nType: `Function`\n\nMap files before extracting: E.g:\n\n```js\ndecompress('unicorn.zip', 'dist', {\n\tmap: file =\u003e {\n\t\tfile.path = `unicorn-${file.path}`;\n\t\treturn file;\n\t}\n}).then(files =\u003e {\n\tconsole.log('done!');\n});\n```\n\n##### plugins\n\nType: `Array`\u003cbr\u003e\nDefault: `[decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]`\n\nArray of [plugins](https://www.npmjs.com/browse/keyword/decompressplugin) to use.\n\n##### strip\n\nType: `number`\u003cbr\u003e\nDefault: `0`\n\nRemove leading directory components from extracted files.\n\n\n## License\n\nMIT © [Kevin Mårtensson](https://github.com/kevva)\n","funding_links":[],"categories":["Packages","包","Compression","目录","Number"],"sub_categories":["Compression","压缩"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fdecompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevva%2Fdecompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fdecompress/lists"}