@dornick/parsers-archive
v0.1.0
Published
Lazy ZIP archive parser for Dornick. Unpacks archive contents into the VFS under /user/files/<id>/parsed/.
Readme
@dornick/parsers-archive
Lazy ZIP archive parser for Dornick — unpack archives client-side and expose contents as VFS paths.
Drop a ZIP onto the page; the agent navigates the entries as if they were a filesystem under /user/files/<id>/parsed/. Powers the personal-data-explorer use case (Google Takeout, Slack exports, etc.) where the file must not leave the browser.
Install
npm i @dornick/parsers-archiveDepends on fflate — a fast, tiny (~30 KB) zip library. The Dornick shim itself is < 1 KB.
Use
import { Dornick } from "@dornick/core";
import { archiveParser } from "@dornick/parsers-archive";
const dornick = new Dornick({ config, transport });
dornick.parsers.add(archiveParser);Paths produced
| Path | Content |
|---|---|
| index.json | { totalEntries, totalUncompressedBytes, entries: [{ path, size, isDir }] } |
| summary.txt | Plain-text overview with first ~12 entries |
| entries/<path> | UTF-8 text of any entry inside the ZIP |
The entries/<path> paths are dynamic — claimed by the parser's claims() method. The agent reads index.json to discover the structure, then issues targeted reads against entries/... for the content it cares about.
Capability gate
requires: ["wasm"] — fflate uses WebAssembly internally for speed.
Memory
Unzipped entries are cached per-file in memory once read. For very large archives (multi-GB exports), use dornick.capabilities.storage.estimateMB to gate uploads in onFileUpload.
See also
License
MIT — © Dipankar Sarkar
