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

npm-packs

v1.0.4

Published

A CLI tool to run npm pack and store the .tgz file in the packs directory

Downloads

13

Readme

npm-packs

npm-packs 是一个简单的命令行工具,用于列出所有依赖项并将它们打包成 .tgz 文件,同时可以清理指定目录中的历史构建缓存。

亮点

解决了项目离线安装中构建依赖需要的每个手动执行 npm pack 生成 .tgz 文件。 将文件统一构建完成后拷贝到没有网络连接的机器上,在使用 npm install 安装。

  • 简化依赖项打包:自动化打包过程,减少了手动操作,提高了效率。
  • 离线安装支持:将 .tgz 文件拷贝到没有网络连接的机器上,使用 npm install 安装,实现离线安装。
  • 灵活配置:支持指定输出目录和忽略特定模块,适应不同的需求和场景。

安装

npx npm-packs <command> [options]

使用

# 列出所有的依赖项,并将它们打包成 .tgz 文件,存放在指定的目录中,默认目录为 packs。
npx npm-packs build [options]

# 清除指定目录中的 .tgz 文件。
npx npm-packs clean [options]

# [options]
-o, --output <directory>  指定输出目录(默认为 packs)。
-i, --ignore <packages>   忽略指定的模块(默认为 npm-packs),多个模块用逗号分隔。

示例

# 打包依赖项并存储在默认目录 packs 中
npx npm-packs build

# 打包依赖项并存储在指定目录 output 中
npx npm-packs build -o output

# 打包依赖项时忽略 npm-counts 模块
npx npm-packs build -i npm-counts

# 清除默认目录 packs 中的 .tgz 文件
npx npm-packs clean

# 清除指定目录 output 中的 .tgz 文件
npx npm-packs clean -o output
  ./
  ├── README.md
  ├── index.js
  ├── node_modules
  │   └── xxx -> .pnpm/[email protected]/node_modules/xxx
  ├── package.json
+ ├── packs
+ │   └── xxx-12.1.0.tgz
  └── pnpm-lock.yaml