tar-stream

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

Library
npm
v3.2.0
435stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
41/100Fair
Development Activity12
Maintenance0
Community72
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture82
Code Quality78
Innovation70
Learning Curve72

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 10 apps in this directory

TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

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
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
JavaScript
82%
Other

Countly

Analytics · Marketing

5,887

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
68
Dependency
Built with
JavaScript82%
Updated today
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

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
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

11,469

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
68
Dependency
Built with
TypeScript83%
Python11%
Updated yesterday
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

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
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
TypeScript
76%
Other

Joplin

Note Taking

56,003

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
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
TypeScript
96%
Other

Lightdash

Analytics · Data Engineering

6,056

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
66
Dependency
Built with
TypeScript96%
Updated today
TypeScript
87%
Other

strapi

CMS

72,965

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
68
Dependency
Built with
TypeScript87%
JavaScript12%
Updated yesterday
C++
88%
GPL 3.0

typesense

Search

26,449

A blazing-fast, typo-tolerant open-source search engine that delivers instant search experiences with built-in vector, semantic, and geo-search — all from a single binary.

View details
81
Repo Health
85
Technical
77
Dependency
Built with
C++88%
Updated yesterday

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

Search