DartZip
A zip parser, reader and generator written in pure Dart. It is memory efficient, requiring the minimum amount of memory to, for example, extract files.
Install / Use
/learn @kaisellgren/DartZipREADME
Zip
A Zib library written in Dart.
Notes
This library is in progress, and can partially extract Zip files. To be more specific, it can extract non-compressed Zip files such as Zip files containing small text files (they are rarely compressed).
Installation
Add as a dependency to your pubspec.yaml. For example:
dependencies:
zip:
git: git://github.com/kaisellgren/DartZip.git
In the future when http://pub.dartlang.org is launched, there will be a more direct way to do this.
Examples
Extracting an archive
The following code extracts the test.zip file to the given target folder. It works as long as the Zip file does not contain compressed files.
import 'package:dart_zip/zip.dart';
import 'dart:io';
void main() {
var currentPath = new Directory.current().path;
var zip = new Zip('test.zip');
zip.extractTo(new Path.fromNative("${currentPath}/test-extraction/"));
}
Creating an archive
This code demonstrates how to dynamically add files to an archive and save it. Support for other actions will arrive at some point.
import 'package:dart_zip/zip.dart';
import 'dart:io';
void main() {
var zip = new Zip('test.zip');
zip.addFileFromString('something.txt', 'content goes here');
zip.save();
}
TODO
- No support for compression yet. Zips are stored without compression, and existing archives that are compressed can't be decompressed.
- Encryption.
- Signatures.
- More API stuff.
Notes
I'm kind of waiting to see if Dart gets an official support for compression algorithms as they would perform much better that way.
License
The library is licensed under MIT. Feel free to use it for any purpose.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
