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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tgz-package-downloader

v1.0.10

Published

download tarball from package-json

Downloads

15

Readme

tgz-package-downloader

简介

tgz-package-downloader 是一个能够将 JavaScript 项目中使用的依赖包(包括 dependencies、devDependencies 和 peerDependencies)的所有镜像 tgz 文件和 package.json 文件下载保存到本地的工具。

安装

npm install tgz-package-downloader -g

使用方法

命令简写

可使用全拼的命令download-tgz 或简写 dt来执行此脚本

通过本地 package.json 文件下载包

download-tgz package-json path/to/package.json

或者

dt json path/to/package.json

通过远程 package.json 文件下载包

download-tgz package-json https://example.com/path/package.json

通过包名和版本下载包(包括该包的所有底层依赖)

download-tgz package packageName version

通过 package-lock.json 文件下载包(推荐)

由于 package-lock.json 文件包含了所有依赖包的信息,这种方式速度更快且不易丢包:

download-tgz package-lock path/to/package-lock.json

或者

dt lock path/to/package-lock.json

通过 packages 命令批量下载 npm 包

可以下载指定数量的不同版本:

download-tgz packages packageName versionNumber

注意事项

  1. 网络依赖:下载 tgz 包需要网络连接,下载速度取决于你的网络速度。
  2. 磁盘空间:下载过程会消耗磁盘空间,完成后请注意清理不需要的文件。
  3. 检查错误日志:下载完成后请参照生成的 error.log 文件,查看是否有未下载成功的文件,必要时重新执行命令下载。
  4. 内网开发测试(推荐):在将包导入内网开发环境前,建议使用 Verdaccio 进行测试,防止版本不兼容的问题。注意某些包可能包含二进制文件,可能会导致下载失败。
  5. 保留锁文件:如果是根据 package-lock.jsonpackage.json 文件进行下载,请保留生成的 package-lock.json 文件以备后续使用。
  6. 其他注意事项:在windows中如果遇到权限问题,请使用git bash等终端执行脚本

keyword

tgz-package-downloader

参考

node-tgz-downloader

tgz-package-downloader 基于 node-tgz-downloader,进行了优化以满足更多使用场景和需求。