streaming-tar
v0.1.1
Published
A pure-TypeScript streaming Tar parser for Web-compatible JavaScript runtimes.
Downloads
124
Readme
import * as tar from "streaming-tar";
const resp = await fetch("https://registry.npmjs.org/react/-/react-18.2.0.tgz");
const tarStream = resp.body.pipeThrough(new DecompressionStream("gzip"));
for await (const entry of tar.entries(tarStream)) {
const contents = await entry.text();
console.log(entry.name, contents);
}
Features
- Streaming support
- Supports Node.js, Deno, Cloudflare Workers, and other Web-compatible JavaScript runtimes
- Zero dependencies
- Small footprint, less than 1KB minified and gzipped.
Requirements
- A Web-compatible JavaScript runtime (Node.js, Deno, Bun, Cloudflare Workers, etc.)
Installation
Via npm:
npm install streaming-tar
Via yarn:
yarn add streaming-tar
Via pnpm:
pnpm add streaming-tar
Via deno:
import * as tar from "https://deno.land/x/streaming_tar/mod.ts";