Files
2026-05-27 23:47:53 +01:00
..
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00

@suaveplan/drive-storage-zip - ZIP archive adapter for @suaveplan/drive: parses EOCD/ZIP64, central directory, local headers; supports store + deflate compression, WinZip AE-2 AES-256 decryption, split-volume reassembly, and read-only / copy-on-write / rewrite mutation modes via the drive-storage-archive-core conformance harness.

ZIP archive adapter for @suaveplan/drive. Reads and writes standards-compliant zip archives through the structural DriveStorage view; supports ZIP64, split volumes, WinZip AE-2 AES-256 decryption (read-only in v0.1.0), and three explicit mutation modes (read-only, copy-on-write, rewrite).

import { ZipArchiveStorage } from "@suaveplan/drive-storage-zip";

const storage = await ZipArchiveStorage.open({
    source: archiveBytes,
    mode: "read-only",
});
const payload = await storage.get("docs/readme.md");

See the package source for full surface area details.

Documentation tree

  • errors — Defines the stable, machine-readable error code registry for the @suaveplan/drive-storage-zip package. Every failure…
    • error-codes — Defines the stable, machine-readable error code registry for the @suaveplan/drive-storage-zip package. Every failure…
  • parse-cdr-entry — Decodes one Central Directory File Header record (signature 0x02014b50) plus its three variable-length tails (filenam…
  • walk-cdr — Iterates the central directory sequentially and returns every parsed CdrEntry. Built on top of parseCdrEntry, it se…
  • compress — Encodes one entry payload for inclusion in a zip archive. Picks between method 0 (STORE) and method 8 (DEFLATE) accordi…
  • decompress — Materialises an entry's plaintext bytes from its compressed payload. This module owns the dispatch on PKZIP compression…
  • aes-decrypt — Implements WinZip AE-2 (and AE-1) AES decryption for ZIP entries that advertise the AE extra field (0x9901). Performs…
  • aes-write-block — Hosts the stub for the v0.2.0 WinZip AE-2 write path. The v0.1.0 adapter is deliberately read-only for AES-encrypted en…
  • find-eocd — Locates the End-Of-Central-Directory signature within the trailing window of a ZIP buffer. ZIP archives terminate with…
  • parse-eocd — Decodes the 22-byte End-Of-Central-Directory record at a known offset in the archive buffer. The function performs stri…
  • parse-eocd64 — Provides decoders for the ZIP64 End-Of-Central-Directory locator and record plus a merge helper that overlays the 64-bi…
  • parse-local-header — Decodes a Local File Header — the per-entry preamble written immediately before each compressed payload. The CDR carrie…
  • read-entry-bytes — Given a parsed CdrEntry and the underlying archive buffer, returns the raw (still-compressed, still-encrypted) payloa…
  • crc32 — Computes the IEEE 802.3 CRC-32 (polynomial 0xEDB88320, little-endian reflected) used by every ZIP entry. The CRC stor…
  • signatures — Central registry of every fixed-width magic number, extra-field tag, and bit-flag bit position the ZIP parser and encod…
  • encode-zip — Encodes a list of plaintext entries into a complete, standards-compliant ZIP byte buffer. Used by `ZipArchiveStorage.fl…
  • normalize-path — Validates and canonicalises an entry path before it enters the ZIP write pipeline. The function defends against the cla…
  • zip-archive-storage — Implements the ZipArchiveStorage class — a DriveStorage-compatible adapter that exposes the entries of a ZIP archiv…