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

tgz-downloader

v2.0.7

Published

download tgz package

Readme

tgz-downloader

Node CI

Download npm packages as tarballs (.tgz) from lockfiles for offline use or Nexus upload.

Features

  • Support for multiple lockfile formats:
    • yarn.lock (V1)
    • package-lock.json (npm)
    • pnpm-lock.yaml (V6 and V9)
  • Downloads all dependencies (including transitive ones) as .tgz files
  • Useful for:
    • Offline installation
    • Uploading to internal Nexus/Artifactory
    • Backup package dependencies

Install

Global Installation

npm install tgz-downloader -g

Local Development

git clone https://github.com/kungege/tgz-downloader.git
cd tgz-downloader
pnpm install
pnpm build

Usage

Command Line

tgz-download --lockfilePath=/path/to/your/pnpm-lock.yaml --outputDir=/path/to/output

Options

| Option | Required | Default | Description | |--------|----------|---------|-------------| | --lockfilePath | Yes | - | Path to lockfile (yarn.lock, package-lock.json, or pnpm-lock.yaml) | | --outputDir | No | ./tgz-packages | Directory to save downloaded tgz files |

Examples

# Download from pnpm-lock.yaml
tgz-download --lockfilePath=./pnpm-lock.yaml --outputDir=./tgz-packages

# Download from package-lock.json
tgz-download --lockfilePath=./package-lock.json

# Download from yarn.lock
tgz-download --lockfilePath=./yarn.lock --outputDir=./packages

Lockfile Support Status

| Lockfile | Format Version | Status | |----------|---------------|--------| | yarn.lock | V1 | ✅ Supported | | package-lock.json | V1-V3 | ✅ Supported | | pnpm-lock.yaml | V6 | ✅ Supported | | pnpm-lock.yaml | V9 (lockfileVersion: '9.0') | ✅ Supported |

Note on pnpm v9 Support

Starting from v9, pnpm changed the lockfile format. The packages section keys are now in the format name@version (e.g., @algolia/[email protected]), and the resolution field no longer contains tarball URLs. This tool will automatically construct the correct download URLs from the registry.

Registry

By default, the tool downloads packages from:

  • Default: https://registry.npmjs.org/
  • China Mirror (if needed): https://registry.npmmirror.com/

Output Structure

The downloaded .tgz files will be organized in the output directory:

tgz-packages/
├── package-name-1.0.0.tgz
├── @scope/
│   └── package-name-2.0.0.tgz
└── types/
    └── @types/
        └── node-20.0.0.tgz

Use Cases

Uploading to Nexus

After downloading all tgz files, you can upload them to your internal Nexus:

# Navigate to the output directory
cd tgz-packages

# Upload to Nexus (example using curl)
for tgz in *.tgz; do
  curl -v --user 'username:password' \
    --upload-file "$tgz" \
    "https://nexus.company.com/repository/npm-hosted/${tgz}"
done

Installing from Local tgz Files

# Install a single package
npm install ./tgz-packages/package-name-1.0.0.tgz

# Install all packages
npm install ./tgz-packages/*.tgz

License

tgz-downloader is licensed under the MIT license.