{"id":19776907,"url":"https://github.com/rusty-ferris-club/decompress","last_synced_at":"2025-04-30T19:31:13.284Z","repository":{"id":63895183,"uuid":"571594605","full_name":"rusty-ferris-club/decompress","owner":"rusty-ferris-club","description":"Extracting archives made easy for Rust 🦀","archived":false,"fork":false,"pushed_at":"2023-07-15T15:45:06.000Z","size":146,"stargazers_count":7,"open_issues_count":10,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T13:28:17.045Z","etag":null,"topics":["decompress","rust","rust-lang","tar","unpack","zip"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rusty-ferris-club.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-11-28T13:22:31.000Z","updated_at":"2023-12-14T10:44:21.000Z","dependencies_parsed_at":"2023-12-27T00:22:37.877Z","dependency_job_id":"43aea87d-d757-4e4a-8b22-594391ce211b","html_url":"https://github.com/rusty-ferris-club/decompress","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.375,"last_synced_commit":"80a977149f828556e4d2682778c8d499b791ea5a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty-ferris-club%2Fdecompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty-ferris-club%2Fdecompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty-ferris-club%2Fdecompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusty-ferris-club%2Fdecompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rusty-ferris-club","download_url":"https://codeload.github.com/rusty-ferris-club/decompress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224221489,"owners_count":17275870,"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","rust","rust-lang","tar","unpack","zip"],"created_at":"2024-11-12T05:22:22.167Z","updated_at":"2024-11-12T05:22:22.723Z","avatar_url":"https://github.com/rusty-ferris-club.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Decompress\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-rusty_ferris_club/decompress-8dagcb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/rusty-ferris-club/decompress)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/decompress.svg?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/decompress)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-decompress-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/decompress)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/workflow/status/rusty-ferris-club/decompress/Build/master?style=for-the-badge\" height=\"20\"\u003e](https://github.com/rusty-ferris-club/decompress/actions?query=branch%3Amaster)\n\nA library that supports decompression of archives in multiple formats, inspired by ergonomics from Node's [decompress](https://github.com/kevva/decompress).\n\n* Includes a default stack of decompressors supporting: `zip`, `tar`, `tar.gz`, `tar.bz2`, `tar.xz`, `tar.zst` (zstd compression), `ar` (Unix Archive)\n* Build your own decompressors and add them\n* Compose a custom stack (exclude compressors, respond to different file extensions)\n* Use `cargo` features to avoid compiling formats you don't need\n\n# Dependency\n\n```toml\n[dependencies]\ndecompress = \"0.1.0\"\n```\n\n\n# Usage\n\nDefault use:\n\n```rust\ndecompress::decompress(archive, to, \u0026ExtractOpts::default());\n```\n\nStrip the first component of all paths in the archive (for when you have a wrapper folder you don't need):\n\n```rust\ndecompress::decompress(archive, to, \u0026ExtractOpts{ strip: 1 });\n```\n\nA micro optimization:\n\n```rust\nlet decompressor = decompress::Decompress::default()\n// use decompressor\n// decompressor.decompress(...)\n```\n\nBuild your own stack:\n\n```rust\nuse regex::Regex;\nlet decompressor = decompress::Decompress::build(vec![decompressors::zip::Zip::build(Some(\n    Regex::new(r\".*\").unwrap(),\n))]);\n// use decompressor\n// decompressor.decompress(...)\n```\n\nIt's also possible to filter unwanted files, similar to [nodejs decompress](https://github.com/kevva/decompress)\n```rust\nlet decompressor = decompress::Decompress::default();\nlet res = decompressor.decompress(\n    archive,\n    to,\n    \u0026ExtractOptsBuilder::default()\n        .strip(strip)\n        .filter(|path| {\n            if let Some(path) = path.to_str() {\n            return path.ends_with(\"abc.sh\");\n            }\n            false\n        })\n        .build()\n        .unwrap(),\n);\n```\n\nMapping paths is also supported\n```rust\nlet decompressor = decompress::Decompress::default();\nlet res = decompressor.decompress(\n    archive,\n    to,\n    \u0026ExtractOptsBuilder::default()\n        .strip(strip)\n        .map(|path| {\n            let mut path = path.to_path_buf();\n            path.set_file_name(format!(\n                \"abc-{}\",\n                path.file_name().unwrap().to_str().unwrap()\n            ));\n            path.into()\n        })\n        .build()\n        .unwrap(),\n);\n```\n\n\n# Copyright\n\nCopyright (c) 2022 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty-ferris-club%2Fdecompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusty-ferris-club%2Fdecompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusty-ferris-club%2Fdecompress/lists"}