{"id":17008743,"url":"https://github.com/i-e-b/simplecompress","last_synced_at":"2026-04-27T18:32:48.385Z","repository":{"id":57359897,"uuid":"41475215","full_name":"i-e-b/SimpleCompress","owner":"i-e-b","description":"Multi-file compression with long paths and many duplicate files, for packaging and deploying NodeJS projects","archived":false,"fork":false,"pushed_at":"2018-05-18T09:56:56.000Z","size":361,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-30T05:05:07.799Z","etag":null,"topics":["archiving","compression","installation","old","signing","working"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-e-b.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":"2015-08-27T08:35:55.000Z","updated_at":"2023-08-30T12:49:26.000Z","dependencies_parsed_at":"2022-09-06T21:41:36.763Z","dependency_job_id":null,"html_url":"https://github.com/i-e-b/SimpleCompress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FSimpleCompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FSimpleCompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FSimpleCompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FSimpleCompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/SimpleCompress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244958837,"owners_count":20538621,"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":["archiving","compression","installation","old","signing","working"],"created_at":"2024-10-14T05:29:10.302Z","updated_at":"2026-04-27T18:32:48.376Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleCompress\nMulti-file compression with long path support and good compression when source has many duplicate files\n\nThe C# version specifically uses only standard GAC dependencies so it can be included in .msi installers.\n\n**Important** This tool does not keep track of file permissions, flags, creation dates or any other\nmeta-data. It will lose execute flags.\n\nSymlinks are supported for directories. If a link target is outside the archive, it will be dereferenced\nand expanded to a normal file. If the link target is within the archive, it will be restored as a link.\n\nThe npm package can be installed as a library, or as a CLI tool \"sz\" with `npm i -g simple-compress`.\n\n    Usage:\n        sz pack \u003csrc directory\u003e \u003ctarget file\u003e [flags]\n        sz unpack \u003csrc file\u003e \u003ctarget directory\u003e [flags]\n\n    Flags:\n        h : (unpack) replace duplicate files with hard links\n        x : (pack) create an expander script for the archive\n\n### Internals\n\nFilesystem / IO:\n\nThe .Net version uses a cut down version of https://github.com/i-e-b/tinyQuickIO to handle long file paths in Windows.\nThe built in .Net IO namespace often fails with `node_modules` folders in large projects.\nNote that long file names are not currently supported for compressed and temp files.\n\nCompression:\n\nIt works like a tar-gz: First all files are checked for duplicates\n(if it has the same name and MD5 it is considered a duplicate).\nThen a temp file is written that is of the structure `\u003cMD5:16 bytes\u003e\u003clength:8 bytes\u003e\u003cpaths:utf8 str\u003e\u003clength:8 bytes\u003e\u003cdata:byte array\u003e`\nrepeated for each unique file. Lengths are 64 bit little endian. Paths are UTF-8. Data is as in the source file.\nThis temp file is then compressed to a single gzip stream as the final output (it is **not** a .zip file)\nIf a signature is added, the final format is `\u003c\"szX509\":6 bytes\u003e\u003csig-length:8 bytes\u003e\u003csignature:byte array\u003e\u003cgzip-data:byte array\u003e`\n\nDecompression:\n\nReverse of compression -- first the gzip stream is expanded out to a temp file, then the structure is read to get a\nlist of paths. The data is then read to disk at first path in the list, then that result file is copied around to all\nthe other locations. Each file when written can be compared to the archive's MD5 hash and an error displayed if there\nis any corruption.\nWhen a signed file is read, the signature header is read, and optionally checked. The remaining data follows the normal expansion process.\nIf a signature `.cer` file is provided, the signature must match the data. If not signature file is provided, the check is skipped\nand the data can be expanded as normal.\n\n### Notes on signing\n\nWindows:\n\nRecipients should only ever get the public key (`*.cer`). Simple compress does no checking against certificate revocation.\nNever use included demo keys for anything other than running unit tests.\n\n```\nmakecert.exe -sv MyKey.pvk -n �CN=MyProjName� MyKey.cer\npvk2pfx.exe -pvk MyKey.pvk -spc MyKey.cer -pfx MyPFX.pfx -po your-password-here\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fsimplecompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fsimplecompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fsimplecompress/lists"}