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

@hwwnpmjs555/pkgq

v1.0.0

Published

A CLI tool to search and query package.json dependencies information

Readme

pkgq - Package Query CLI Tool

一个用于搜索和查询 package.json 中依赖信息的命令行工具。

功能特性

  • 🔍 搜索 package.json 中的依赖包
  • 📦 列出所有依赖包及其详细信息
  • 🌐 从 npm registry 获取包的最新信息
  • 💡 显示包的描述、版本、作者、许可证等信息
  • 🎨 美观的表格和彩色输出
  • ⚡ 支持生产依赖和开发依赖的分别查看

安装

# 克隆项目
git clone <repository-url>
cd pkgq

# 安装依赖
npm install

# 全局安装(可选)
npm install -g .

使用方法

全局选项

# 指定package.json文件路径(默认是当前目录的package.json)
pkgq -f /path/to/package.json [command]
pkgq --file ./other-project/package.json [command]

列出所有依赖

# 列出所有依赖(生产 + 开发)
pkgq list

# 只列出开发依赖
pkgq list --dev

# 只列出生产依赖
pkgq list --prod

# 指定其他package.json文件
pkgq -f ./other-project/package.json list

搜索包

# 搜索包名包含 "react" 的依赖
pkgq search react

# 搜索并显示详细信息
pkgq search react --info

# 在指定文件中搜索
pkgq -f ./other-project/package.json search react

获取包详细信息

# 获取特定包的详细信息
pkgq info lodash

命令详解

全局选项

  • -f, --file <path> - 指定package.json文件路径(默认:package.json)

pkgq list [options]

列出 package.json 中的所有依赖包,并从 npm registry 获取最新版本信息。

选项:

  • -d, --dev - 包含开发依赖
  • -p, --prod - 只包含生产依赖

输出包含:

  • 包名
  • 当前版本 → 最新版本
  • 包描述
  • 项目主页

pkgq search <query> [options]

在当前项目的依赖中搜索包含指定关键词的包。

选项:

  • -i, --info - 显示找到的包的详细信息

pkgq info <package>

获取指定包的详细信息。

显示信息:

  • 最新版本
  • 包描述
  • 作者
  • 许可证
  • 项目主页
  • 关键词
  • 最近版本历史

示例

# 查看所有依赖
pkgq list

# 搜索 React 相关的包
pkgq search react

# 获取 lodash 的详细信息
pkgq info lodash

# 只查看开发依赖
pkgq list --dev

# 搜索 webpack 相关包并显示详细信息
pkgq search webpack --info

# 查看其他项目的依赖
pkgq -f ../other-project/package.json list

# 在指定文件中搜索包
pkgq --file ./frontend/package.json search react

依赖

  • commander - 命令行参数解析
  • axios - HTTP 请求
  • chalk - 终端颜色输出
  • ora - 加载动画
  • table - 表格输出格式化

许可证

MIT