zebp / streaming-tar

A pure-TypeScript streaming Tar parser for Web-compatible JavaScript runtimes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streaming-tar

A pure-TypeScript streaming Tar parser for Web-compatible JavaScript runtimes.

downloads npm version MIT license

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";

About

A pure-TypeScript streaming Tar parser for Web-compatible JavaScript runtimes

License:MIT License


Languages

Language:TypeScript 100.0%