# trotar **Repository Path**: mirrors_xtuc/trotar ## Basic Information - **Project Name**: trotar - **Description**: A performant tar parser with streaming support - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # trotar > A performant tar parser with streaming support ## Usage ```js import { USTarParser } from "trotar" const parser = new USTarParser; parser.on("file", (name, content) => { console.log("file", name, "has", content); }); await parser.parse(tar); ``` With streaming: ```js import { StreamingUSTarParser } from "trotar" const parser = new StreamingUSTarParser parser.on("file", (name, content) => { console.log("file", name, "has", content); }) const res = await fetch("https://registry.npmjs.org/hi-sven/-/hi-sven-1.29.0.tgz") const writableStream = new WritableStream( { async write(chunk) { parser.write(chunk); }, close() { console.log("closed"); }, abort(err) { console.error("Sink error:", err); }, }, ); const ds = new DecompressionStream('gzip') res.body.pipeThrough(ds).pipeTo(writableStream) ```