Deterministic directory archiving and extraction over zip, tar, and layered compression.
Supports Node.js, Deno, and Bun.
dir-archiver provides one API surface for archive operations with explicit safety profiles and stable error codes.
npm install dir-archiver
deno add jsr:@ismail-elkorchi/dir-archiverimport { write, detect, extract } from "dir-archiver";
await write("./project", "./project.zip", {
format: "zip",
includeBaseDirectory: true,
});
const detected = await detect("./project.zip");
await extract("./project.zip", "./out", { profile: "strict" });
console.log(detected.format);- You only need a low-level parser for a single format.
- You target CommonJS-only environments or Node < 24.
- You need interactive archive browsing UI features.
- You need one API for detect, list, audit, extract, normalize, and write.
- You want deterministic normalization for CI pipelines.
- You need safety profiles for untrusted inputs.
- Module system: ESM-only.
- Runtimes: Node
>=24, current Deno, current Bun. - CLI and API contracts are documented in Contract.
npm run examples:run
npm run check:fast
npm run check