npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tar-vern

v1.3.0

Published

Tape archiver library for Typescript

Readme

Tape archiver library for Typescript

Tape archiver (tar) library for Typescript implementation.

tar-vern

Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: MIT


What is this?

A modern TypeScript library for creating tape archives (tar/ustar format) using streaming API. Supports both files and directories with metadata preservation, GZip compression, readable streaming, and flexible content sources.

Features

  • Streaming API: Memory-efficient processing of large files
  • Multiple content sources: String, Buffer, ReadableStream, file paths and async generators
  • Metadata preservation: File permissions, ownership, timestamps
  • Built-in compression: GZip compression support (tar.gz format)
  • No external dependencies.

Installation

npm install tar-vern

Minimal sample code

tar-vern supplies file and directory information to pack through "TypeScript async generator." This allows you to specify pack data with very concise code.

import {
  createTarPacker, storeReaderToFile,
  createFileItem, createDirectoryItem } from 'tar-vern';

// Create an async generator for tar entries
const itemGenerator = async function*() {
  // Add a simple text file
  yield await createFileItem(
    'hello.txt',      // file name
    'Hello, world!'   // text contents
  );
  
  // Add a directory
  yield await createDirectoryItem('mydir');

  // (Make your own entries with yield expression...)
};

// Create GZipped tar stream and write to file
const packer = createTarPacker(itemGenerator(), 'gzip');
await storeReaderToFile(packer, 'archive.tar.gz');   // Use helper to awaitable

tar-vern provides tar extraction through async generator too, allowing you to process entries as they are extracted from the tar archive.

import { createReadStream } from 'fs';
import { createTarExtractor } from 'tar-vern';

// Read GZipped tar file and extract entries
const readableStream = createReadStream('archive.tar.gz');

for await (const extractedItem of createTarExtractor(readableStream), 'gzip') {
  if (extractedItem.kind === 'file') {
    console.log(`File: ${extractedItem.path}`);
    
    // Get content as string or buffer
    const content = await extractedItem.getContent('string');
    console.log(`Content: ${content}`);
  } else {
    console.log(`Directory: ${extractedItem.path}`);
  }
}

Features

  • Bidirectional streaming: Both creation and extraction of tar archives
  • Memory-efficient: Streaming API for processing large files without content buffering
  • Multiple content sources: String, Buffer, ReadableStream, file paths and async generators
  • Metadata preservation: File permissions, ownership, timestamps
  • Built-in compression/decompression: GZip compression support (tar.gz format)
  • Flexible content access: Extract files as string, Buffer, or Readable stream on demand
  • Error handling: Comprehensive validation and error reporting
  • Abort signal support: Cancellable operations
  • No external dependencies: Pure TypeScript implementation

For more information, see repository documents.


License

Under MIT.