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

@dongdong12138/dh-cli

v0.0.1

Published

BarryDong 的 cli 工具

Readme

DH-CLI

BarryDong 的 CLI 工具,用于快速创建各框架的前端项目。

环境要求

  • Node.js: >= 18.0.0
  • pnpm: >= 8.0.0

安装

# 如果没有 pnpm,先安装 pnpm
npm install -g pnpm

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

# 安装依赖
pnpm install

# 构建项目(必须先构建)
pnpm run build

# 全局链接
pnpm link --global

使用方法

创建项目

dh-cli create <project-name>

例如:

dh-cli create my-app

运行后会提示你选择框架:

  • Vue
  • React
  • uni-app

选择完成后,工具会显示你的选择并创建项目。

开发

# 开发模式(直接运行 TypeScript)
pnpm run dev

# 类型检查
pnpm run type-check

# 构建(压缩版本)
pnpm run build

# 构建(开发版本,不压缩)
pnpm run build:dev

# 测试
pnpm run start

技术栈

  • Commander.js: 命令行参数解析
  • Inquirer.js: 交互式命令行界面
  • TypeScript: 类型安全的 JavaScript
  • esbuild: 快速的 TypeScript 编译和代码压缩
  • ts-node: TypeScript 开发时运行时支持
  • pnpm: 快速、节省磁盘空间的包管理工具

项目结构

dh-cli/
├── bin/
│   └── cli.js          # CLI 可执行文件(编译后的 JavaScript)
├── src/
│   └── index.ts        # TypeScript 源码
├── package.json
├── tsconfig.json
└── README.md

重要说明

  • bin/cli.js:TypeScript 通过 esbuild 编译并压缩到这个文件,它是最终的可执行文件
  • 构建必须:每次修改 src/index.ts 后都必须运行 pnpm run build 来重新编译
  • 简洁架构:没有额外的 dist 目录,源码直接编译到可执行文件
  • 代码压缩:使用 esbuild 进行代码压缩,文件大小仅 840 字节
  • 性能优化:使用编译后的文件避免了运行时 TypeScript 编译,提高了性能
  • 类型安全:使用 pnpm run type-check 进行类型检查,确保代码质量

许可证

ISC