Zum Hauptinhalt springen
Zurück zu Plugins
@capgo/capacitor-zip
Tutorial
@capgo/capacitor-zip

Zip

Ein kostenloses Capacitor-Plugin für das Zubern und Entzubern von Dateien auf iOS, Android und Web.

Richtlinie

Tutorial zum Zip

Mit @capgo/capacitor-zip verwenden

Capacitor-Zip-Plugin für das Komprimieren und Extrahieren von Zip-Archiven.

Installieren

bun add @capgo/capacitor-zip
bunx cap sync

Was diese Erweiterung enthüllt

  • zip - Eine Datei oder ein Verzeichnis komprimieren, um ein ZIP-Archiv zu erstellen.
  • unzip - Ein ZIP-Archiv in ein bestimmtes Zielverzeichnis entpacken.

Beispiel für die Verwendung

zip

Eine Datei oder ein Verzeichnis komprimieren, 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 ein bestimmtes Zielverzeichnis entpacken.

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

Weitermachen von Using @capgo/capacitor-zip

Wenn Sie Mit @capgo/capacitor-zip native Plugin-Arbeit planen, verbinden Sie es mit @capgo/capacitor-zip für die Implementierungsdetails in @capgo/capacitor-zip, Einstieg für die Implementierungsdetails in Einstieg, Capgo Plugin-Verzeichnis für den Produktworkflow in Capgo Plugin-Verzeichnis, Capacitor Plugins von Capgo für die Implementierungsdetails in Capacitor Plugins von Capgo, und Plugins hinzufügen oder aktualisieren für die Implementierungsdetails in Plugins hinzufügen oder aktualisieren.