Archiver
A streaming Node.js library for generating ZIP and TAR archives on the fly
Repository Health
Technical Analysis
Archiver is a battle-tested Node.js library that provides a unified, streaming interface for generating archive files. It ships with out-of-the-box support for the ZIP and TAR formats and lets you append data from files, strings, buffers, readable streams, glob patterns, and entire directories, all while piping the compressed output directly to any writable destination.
Built on top of Node’s native stream primitives, Archiver keeps memory usage low even for very large archives by processing entries through an internal work queue rather than buffering everything up front. With over 31 million weekly downloads it is one of the most widely relied-upon packaging libraries in the JavaScript ecosystem.
What You Get
- A single streaming API that produces both ZIP and TAR (including gzip-compressed .tar.gz) archives
- Flexible entry sources: files, strings, buffers, readable streams, glob patterns, and recursive directories
- Fine-grained per-entry control over names, dates, permissions, path prefixes, and symlink handling
- Progress and lifecycle events (entry, progress, warning, error) plus a byte pointer for tracking output size
- Low, predictable memory usage via an internal concurrency-limited work queue
Common Use Cases
- Generating downloadable ZIP bundles on the fly in an Express or other HTTP server response
- Packaging build artifacts, logs, or backups into TAR/TAR.GZ files from a Node script
- Bundling user-uploaded files or exported data into a single archive for download
- Creating deployment or release archives as part of a CI/CD pipeline
Under The Hood
Architecture — Archiver centers on lib/core.js, an 851-line Archiver class extending readable-stream’s Transform. Format-specific classes in index.js (ZipArchive, TarArchive, JsonArchive) subclass the core and wire in a pluggable format engine from lib/plugins/ (zip.js delegates to zip-stream, tar.js to tar-stream). Appended entries flow through two async work queues — a stat queue (default concurrency 4) that resolves filesystem metadata and a serial processing queue that feeds each normalized entry into the format module, whose output is piped back through the Transform, keeping memory flat and honoring highWaterMark backpressure. finalize() drains the queues and closes the underlying module.
Tech Stack — Pure JavaScript ES modules targeting Node >=18. Runtime dependencies are small, focused packages: zip-stream and tar-stream for format encoding, readable-stream for stream primitives, async for the work queues, readdir-glob/normalize-path/lazystream for directory and glob traversal, buffer-crc32 and is-stream as helpers. Tests use Mocha with Chai; docs are generated via JSDoc.
Code Quality — Well-structured with clear separation between the streaming core, the error module, utilities, and per-format plugins. Errors are centralized in lib/error.js as a coded ArchiverError with a fixed table of validation messages, and input validation is explicit throughout the append path. A substantial test suite (~710 lines across test/archiver.js and test/plugins.js) exercises the core and each format, and the public API is thoroughly documented with JSDoc annotations.
API Design — The API is highly ergonomic: instantiate a format class, attach error/warning handlers, pipe() to an output, then append(), file(), directory(), or glob() and call finalize(). Method names read naturally, options are consistent across formats, and switching output format is a one-line change. The README quick-start plus a directory of runnable examples make the getting-started path short with minimal boilerplate.
Used by 40 apps in this directory
Super Productivity
Productivity · Project Management
A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.
Teable
Databases · No Code Platforms
A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.
twenty
CRM
The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.
Wire
Collaboration · Team Chat · Video Conferencing
Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.