# 告别依赖地狱：modern-tar 零依赖极速解析

Original title: Zero-dependency streaming tar parser and writer for JavaScript

> Hacker News story 48957321 · language: zh · submitted 2026-07-18
> Web version: https://zeli.app/zh/story/48957321
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 26 · by [ayuhito](<https://news.ycombinator.com/user?id=ayuhito>) · 💬 0
[original](<https://ayuhito.com/projects/modern-tar/>) · [HN discussion](<https://news.ycombinator.com/item?id=48957321>)

## Summary

NPM 生态的依赖包袱太重了，庞大的依赖树拖慢了应用，还增加了供应链攻击的风险。作为 e18e.dev 运动的一员，我亲手打造了 modern-tar，证明我们可以用零依赖和现代原语构建更快、更轻的 TAR 解析器。我彻底解耦了解析逻辑与 I/O 层，核心引擎是一个纯同步状态机，配合零拷贝环形缓冲区，极大降低了内存开销和 GC 压力。针对并发处理中的 TOCTOU 竞争条件，我设计了基于 Promise 链的路径缓存机制，在确保严格顺序的同时实现并行加速。实测数据显示，在处理大量小文件时，modern-tar 比 node-tar 快 1.4 倍，比 tar-fs 快 2.6 倍，且完美支持浏览器环境。

## Key quote

> 巨大的依赖树会拖慢应用速度，降低安装效率，并大幅增加供应链攻击的潜在风险。

---

## Cite

- Page: https://zeli.app/zh/story/48957321
- Date: 2026-07-18
- Source: ayuhito.com (https://ayuhito.com/projects/modern-tar/)
- Hacker News: https://news.ycombinator.com/item?id=48957321

## Other languages

- en: https://zeli.app/story/48957321 · markdown: https://zeli.app/story/48957321.md
- ja: https://zeli.app/ja/story/48957321 · markdown: https://zeli.app/ja/story/48957321.md
- ko: https://zeli.app/ko/story/48957321 · markdown: https://zeli.app/ko/story/48957321.md
- de: https://zeli.app/de/story/48957321 · markdown: https://zeli.app/de/story/48957321.md
- es: https://zeli.app/es/story/48957321 · markdown: https://zeli.app/es/story/48957321.md
