ZipZap 1.0.3

dotnet add package ZipZap --version 1.0.3
                    
NuGet\Install-Package ZipZap -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZipZap" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZipZap" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="ZipZap" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZipZap --version 1.0.3
                    
#r "nuget: ZipZap, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZipZap@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZipZap&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=ZipZap&version=1.0.3
                    
Install as a Cake Tool

ZipZap - The Zippity Zappity Compression Library 🧙‍♂️✨

Welcome to ZipZap - your one-stop shop for all your zipping and unzipping needs! Whether you're a developer trying to tidy up files, save space, or just love the idea of packaging things into tiny little boxes, ZipZap has got you covered.

Why Choose ZipZap? 🤔

  • No Bloat, Just Zip: Simple to use, no unnecessary dependencies.
  • Speed and Precision: Leverage .NET's built-in System.IO.Compression with a streamlined API.
  • Friendly to Newbies: Default options make it easy to get started.
  • Delete with a Bang: Optionally delete originals after compressing or decompressing - like a digital magic trick.

Getting Started 🏁

Install via NuGet:

dotnet add package ZipZap

Import the namespace into your project:

using YourNamespace.ZipZap;

Features 🚀

1. Compressing Files and Folders

Need to squish a single file or an entire folder? We've got you covered. Here's how:

// Compress a single file
ZipZap.Compress(
    sourcePath: "example.txt",
    zipFilePath: "example.zip"
);

// Compress an entire folder
ZipZap.Compress(
    sourcePath: "MyFolder",
    zipFilePath: "MyFolder.zip",
    overwrite: true
);

Advanced Options:

  • overwrite: Overwrite the existing zip file? Default: false.
  • deleteOriginal: Delete the original file/folder after zipping? Default: false.
  • compressionLevel: Choose from Optimal, Fastest, or NoCompression.
ZipZap.Compress(
    sourcePath: "example.txt",
    zipFilePath: "example.zip",
    overwrite: true,
    deleteOriginal: true,
    compressionLevel: ZipZap.CompressionLevel.Fastest
);

2. Decompressing Files

Open that zipped treasure chest!

// Decompress a zip file
ZipZap.Decompress(
    zipFilePath: "example.zip",
    destinationFolderPath: "ExtractedFolder"
);

// Overwrite existing files and delete the zip after extraction
ZipZap.Decompress(
    zipFilePath: "example.zip",
    destinationFolderPath: "ExtractedFolder",
    overwrite: true,
    deleteZipFile: true
);

Behind the Scenes 🕵️‍♀️

  • File Validation: If a file or folder doesn’t exist, ZipZap will let you know (and won't crash the party).
  • Recursive Compression: Folders are zipped with all their subfolders and files.
  • Safe Defaults: It won’t overwrite files unless you explicitly allow it.

Use Cases 🎉

  • Backups: Quickly compress and store important files.
  • Sharing is Caring: Send multiple files in one tidy package.
  • Digital Spring Cleaning: Compress, delete, and free up space!

FAQ 🧐

Q: What if I try to compress something that doesn’t exist?

A: Don't worry. ZipZap won’t let you compress the void. It will kindly inform you that your source path doesn’t exist.

Q: What happens if the destination zip already exists?

A: Unless you set overwrite to true, ZipZap will politely back off and not overwrite your precious file.

Q: Does it support crazy nested folders?

A: Absolutely! Compress away without fear of losing your folder structures.


Acknowledgments

This library uses the amazing System.IO.Compression under the hood. All we did was sprinkle some magic on top to make it easier to use.


Author

Developed by Håvard Brækken.

Contributing

Feel free to submit issues or create pull requests if you have suggestions or improvements!

License

This project is licensed under the MIT License. See the LICENSE file for more details.

So go ahead, ZipZap your way to file-compression happiness. Happy zipping! ✨

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 212 11/17/2024
1.0.1 177 11/17/2024