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

get-npm-tgz

v1.1.0

Published

download npm tgz

Downloads

21

Readme

get-npm-tgz

对于大多数内网开发人员来说,不能直接从 npm 下载依赖是很痛苦的,所以搭建内网 npm 私服是很有必要的。这个时候就需要下载大量 npmtgz 包上传到 npm 私服,所以 get-npm-tgz 就出现了。搭建内网可参考文章Linux安装Nexus3搭建Npm私服

📦 安装

  npm i get-npm-tgz -g

🚗 用法

根据 package-lock.json 全量下载,在 package-lock.json 所在目录下执行

 # 已全局安装get-npm-tgz
  tgz
  # 在不使用全局安装的情况下可直接使用
  npx get-npm-tgz

指定下载包:

  tgz [email protected] [email protected] -n // 默认使用npm源下载
  -n, --npm      使用npm源下载
  -c, --cnpm     使用cnpm源下载
  -y, --yarn     使用yarn源下载
  -t, --taobao   使用taobao源下载
  -k, --token <token> 传入 `token`, 在下载需要认证的私服tgz时, 必须传入

🤗 说明

  • 执行完命令后会在根目录生成一个 tgz 文件夹,里面存放的就是 package 对应的 tgz
  • 下载失败的包会在 error.txt 文件记录
  • 如果下载失败的包不是很多,建议手动重新下载一下失败的包

⚠️ 注意

  • 低版本的 npm 支持有限,建议使用 [email protected] 及以上版本
  • 指定下载包时需要指定版本号
  • 不指定下载包时根目录必须存在 package-lock.json
  • 目前只支持项目使用npm下载的依赖(即根目录存在 package-lock.json ),如果使用 pnpmyarn 等请使用转化工具转换出 package-lock.json ,或重新使用 npm 下载依赖
  • synp:将 yarn.lock 转化为 package-lock.json
  • pnpm-lock-to-npm-lock:将 pnpm-lock.yaml 转化为 package-lock.json