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

create-pubinfo-pr

v0.244.1

Published

初始化项目框架

Readme

create-pubinfo

Pubinfo 的项目脚手架,用来生成应用模板、模块模板和 monorepo 模板。

它在做什么

  • 提供交互式初始化流程
  • 支持三套本地模板:pubinfo-apppubinfo-modulepubinfo-monorepo
  • 根据勾选结果裁剪可选模块,目前内置 rbac
  • 支持按模板变量渲染 .hbs 文件,并复制原始资源文件
  • 初始化完成后自动尝试执行 git init
  • 保留一套 v1 兼容流程,用远端模板包下载旧版脚手架

基本用法

pnpm create pubinfo
pnpx create-pubinfo
npx create-pubinfo

运行后会询问:

  • 目录名称 dir
  • 项目标识 key
  • 模板类型
  • 是否启用 rbac
  • 是否启用 openapi
  • 使用 v1 还是 v2

非交互式用法

如果需要给 agent、脚本或 CI 调用,可以直接通过命令行参数生成项目:

create-pubinfo --dir my-app --key my-app --template pubinfo-app --modules rbac --openapi false --yes

参数说明:

  • --dir: 目标目录名称
  • --key: 项目标识
  • --template: 模板类型,支持 pubinfo-apppubinfo-modulepubinfo-monorepo
  • --modules: 模块列表,多个模块用逗号分隔;目前支持 rbac,不启用模块可传 none
  • --openapi: 是否启用运行时接口生成,支持 truefalse
  • --yes: 跳过确认;当目标目录已存在时会覆盖该目录

只要传入上述生成参数,CLI 就会进入非交互模式,不再询问 v1/v2 或其他问题。

模板类型

  • pubinfo-app: 单应用模板
  • pubinfo-module: 模块开发模板,带 playground
  • pubinfo-monorepo: monorepo 模板

代码用法

import { generate } from 'create-pubinfo';

await generate({
  templateName: 'pubinfo-app',
  key: 'demo',
  version: '2.2.0',
  modules: ['rbac'],
  openapi: false,
});

主要导出

  • generate: 基于模板生成项目
  • copyTemplate: 直接复制模板目录
  • interaction: 获取交互式选项
  • readPackageJSON: 读取脚手架自身包信息

仓库关系

  • @pubinfo/cligeneratemonorepo 子命令直接复用。
  • templates/ 目录就是这个包真正的核心资产。