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

@laomojituan/cli

v1.0.1

Published

Demo: a minimal npx-runnable Node CLI with an install subcommand

Readme

@laomojituan/cli

一个最小可运行的 Node CLI 骨架,演示如何让工具支持 npx 免安装直接运行,并实现自己的 install 子命令。

  • 零安装体验:npx -y @laomojituan/cli@latest <command>
  • 基于 commander 解析子命令
  • 配置写入用户目录 ~/.darkdemo/,全局/ npx 场景下均可正常工作
  • 要求 Node.js >= 18

快速开始

无需安装,直接用 npx 运行:

npx -y @laomojituan/cli@latest hello 世界
npx -y @laomojituan/cli@latest doctor

想全局安装后使用短命令:

npm install -g @laomojituan/cli
darkdemo --version

或者在 ~/.zshrc / ~/.bashrc 中加一个别名:

alias darkdemo="npx @laomojituan/cli@latest"

命令

| 命令 | 说明 | | --- | --- | | darkdemo install | 初始化工具:预检 Node 版本、写入配置文件 ~/.darkdemo/config.json、输出别名提示 | | darkdemo hello [name] | 演示命令,打个招呼;-y, --yell 大写输出 | | darkdemo doctor | 检查运行环境与安装状态,未安装时给出提示,失败时退出码为 1 | | darkdemo --version | 输出版本号 | | darkdemo --help | 查看帮助 |

install

npx -y @laomojituan/cli@latest install

常用选项:

  • -f, --force:已安装时覆盖配置、重新安装

安装成功后生成的配置文件示例:

{
  "version": "1.0.0",
  "installedAt": "2026-09-05T04:01:34.542Z",
  "node": "26.5.0",
  "platform": "darwin/arm64"
}

本地开发

git clone <repo> && cd darkdemocli
npm install
node cli.js --help          # 直接运行
npm link                    # 全局软链,之后可直接用 darkdemo 命令
darkdemo hello dev
npm rm -g @laomojituan/cli  # 解除软链

入口 cli.js 首行的 shebang(#!/usr/bin/env node)和 package.json 中的 bin 字段是 CLI 能被 npx/npm 识别的关键。新增子命令时,在 cli.js 中注册 program.command(...),并在 src/ 下新增对应模块即可。

发布

npm version patch           # 修订号 +1(minor=新功能,major=破坏性变更)
npm publish --access public # scoped 包必须带 --access public

发布说明:

  • 每次发布必须递增版本号,npm 不允许覆盖已发布版本
  • 账号开启 2FA 时需追加 --otp=<验证码>;CI 场景建议使用勾选了 Bypass 2FA 的 Granular Access Token
  • 发布测试版可用 npm publish --tag beta,用户通过 @beta 安装,不影响 latest
  • 发布后 registry 副本同步可能有 1~2 分钟延迟,期间 npm view 短暂 404 属正常现象

License

MIT