tar-stream

A pure-streaming tar parser and generator for Node.js with no filesystem dependency

Library
npm
v3.2.1
435 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
51 /100 Fair
Development Activity 44
Maintenance 8
Community 72
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 82
Code Quality 78
Innovation 70
Learning Curve 72

tar-stream is a streaming tar parser and generator for Node.js that operates entirely on streams, so you can pack and extract tarballs without ever touching the filesystem. It exposes two complementary duplex-style streams: pack() for building new tar archives and extract() for reading entries out of an existing one, plus an async-iterator interface on the extractor for modern for await consumption.

Because everything is stream-based, tar-stream composes naturally with Node’s pipe chains — piping through a gunzip transform for .tar.gz files, rewriting headers mid-stream to transform an existing archive, or writing a generated pack stream straight to a file, socket, or HTTP response. It implements USTAR with pax extended header support, making it compatible with GNU tar, bsdtar, and other common tar implementations.

What You Get

  • A pack() writable stream for constructing tar archives entry-by-entry from buffers or streams
  • An extract() stream that emits entry events with parsed headers and readable per-entry content streams
  • Async-iterator support on the extractor for for await (const entry of extract) consumption
  • Support for rewriting/modifying an existing tarball by piping extract output into a new pack stream
  • USTAR format with pax extended header support, compatible with gnutar and bsdtar

Common Use Cases

  • Extracting npm-style or Docker-layer tarballs in memory as part of a build or deployment tool
  • Generating tarballs on the fly to stream directly to an HTTP response or another process, without writing to disk
  • Rewriting paths, modes, or ownership in an existing tarball by piping extract into pack
  • Building higher-level filesystem tar tooling (as tar-fs does) on top of a pure-stream tar codec

Under The Hood

Architecture: The package is split into three small files — headers.js parses/encodes the fixed-size USTAR header block plus pax extensions, extract.js implements a duplex stream that reads a byte stream, slices out header blocks and entry bodies, and emits an entry event per file (backpressure-gated until the consumer drains each entry), and pack.js implements the inverse: a readable stream that serializes queued entries (buffer or stream bodies) into header+body blocks. index.js just re-exports both. Tech Stack: Pure JavaScript with no native bindings; runtime dependencies are streamx (the underlying stream primitives), b4a (buffer/Uint8Array interop), fast-fifo (queue for pack entries), and bare-fs for filesystem-optional environments (Bare/browser). Code Quality: Tests live under test/ (pack.js, extract.js, dual.js, plus a slow fixture suite) run via brittle with standard for linting; the library is small (~1,000 lines across the four source files) which keeps the surface easy to audit, though recent commit activity is low (score flags infrequent maintenance) despite very high download volume as a transitive dependency. API Design: The event-based extract.on('entry', (header, stream, next) => ...) pattern requires callers to explicitly drain or resume each entry stream before the next is emitted — a deliberate backpressure design that is easy to get wrong (forgetting next()/resume() stalls the whole archive) but is well documented in the README with explicit warnings.

Used by 12 apps in this directory

TypeScript
96%
Other

Amplication

AI Code Assistants · Automation · Developer Tools

16,015

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
58
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 96%
Updated 3 months ago
JavaScript
83%
Other

Countly

Analytics · Marketing

5,908

Privacy-first, self-hosted analytics and customer engagement platform with full data ownership, GDPR compliance, and AI-powered insights across mobile, web, desktop, and IoT.

View details
96
Repo Health
82
Technical
65
Dependency
Built with
JavaScript 83%
Updated 5 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,441

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
59
Repo Health
90
Technical
61
Dependency
Built with
Java 34%
TypeScript 27%
Scala 26%
Updated 1 months ago
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

11,875

A modern relational spreadsheet that combines Python-powered formulas, drag-and-drop dashboards, and granular access controls in a self-hostable, SQLite-backed data platform.

View details
91
Repo Health
93
Technical
66
Dependency
Built with
TypeScript 83%
Python 11%
Updated 6 days ago
TypeScript
61%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,797

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 61%
Svelte 34%
Updated 1 weeks ago
TypeScript
77%
Other

Joplin

Note Taking

56,513

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 6 days ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,166

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated 5 days ago
Rust
56%
Apache 2.0

Magnitude

AI Development · Developer Tools

5,285

An open source inference engine that profiles your hardware, recommends the best local models, and tunes them for the coding agent you already use.

View details
78
Repo Health
83
Technical
71
Dependency
Built with
Rust 56%
TypeScript 18%
Python 11%
Updated 5 days ago
TypeScript
95%
MIT

qm

AI Agents · AI Assistants · Automation

15,266

An open-source, multiplayer agent harness that gives every employee and every room in a company its own scoped memory, sandbox, and AI agent — in Slack and on the web.

View details
80
Repo Health
88
Technical
84
Dependency
Built with
TypeScript 95%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers