Mit @capgo/capacitor-zip
Capacitor Zip-Plugin für die Komprimierung und Extraktion von Zip-Archiven.
Installieren
bun add @capgo/capacitor-zip
bunx cap sync
Was dieses Plugin bereitstellt
zip- Ein Datei- oder Verzeichnis-Objekt komprimiert, um ein ZIP-Archiv zu erstellen.unzip- Ein ZIP-Archiv in einem bestimmten Zielverzeichnis extrahiert.
Beispiel-Verwendung
zip
Ein Datei- oder Verzeichnis-Objekt komprimiert, um ein ZIP-Archiv zu erstellen.
import { CapacitorZip } from '@capgo/capacitor-zip';
// Compress a directory without password
await CapacitorZip.zip({
source: '/path/to/my-folder',
destination: '/path/to/output.zip'
});
unzip
Ein ZIP-Archiv in einem bestimmten Zielverzeichnis extrahiert.
import { CapacitorZip } from '@capgo/capacitor-zip';
// Extract a standard ZIP archive
await CapacitorZip.unzip({
source: '/path/to/archive.zip',
destination: '/path/to/extract-folder'
});
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-zip/
- Dokumentation: /docs/plugins/zip/
Weitermachen von Using @capgo/capacitor-zip
Wenn Sie Using verwenden Using @capgo/capacitor-zip um native Plugin-Arbeit zu planen, verbinden Sie es mit @capgo/capacitor-zip für die Implementierungsdetails in @capgo/capacitor-zip Getting Started für die Implementierungsdetails in Getting Started Capgo Plugin-Verzeichnis zur Produktworkflow in Capgo Plugin-Verzeichnis Capacitor Plugins von Capgo zur Implementierungsdetail in Capacitor Plugins von Capgo, und Hinzufügen oder Aktualisieren von Plugins zur Implementierungsdetail in Hinzufügen oder Aktualisieren von Plugins.