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

zan-mini-cli

v1.0.2

Published

微信小程序页面和组件生成工具

Readme

微信小程序 CLI 工具

这是一个用于快速生成微信小程序页面和组件的命令行工具。

安装

在项目根目录下运行:

npm run bootstrap

使用方法

创建页面

# 交互式创建页面
npx mini-cli page

# 直接创建页面
npx mini-cli page page-name

# 指定目录和标题创建页面
npx mini-cli page page-name -- --dir path/to/pages --title "页面标题"

创建组件

# 交互式创建组件
npx mini-cli component

# 直接创建组件
npx mini-cli component component-name

# 指定目录和标题创建组件
npx mini-cli component component-name -- --dir path/to/components --title "组件标题"

生成的文件结构

页面文件结构

page-name/
├── page-name.js      # 页面逻辑
├── page-name.json    # 页面配置
├── page-name.wxml    # 页面结构
└── page-name.wxss    # 页面样式

组件文件结构

component-name/
├── component-name.js      # 组件逻辑
├── component-name.json    # 组件配置
├── component-name.wxml    # 组件结构
└── component-name.wxss    # 组件样式

功能特点

  1. 完整的页面模板:包含所有生命周期函数和常用方法
  2. 丰富的组件模板:包含属性、数据、方法和生命周期
  3. 灵活的路径配置:可以自定义生成文件的目录位置
  4. 交互式命令行:支持交互式输入页面/组件信息
  5. 示例代码:生成的文件包含详细的注释和示例代码

配置选项

页面配置

  • --dir:指定页面目录路径
  • --title:指定页面标题

组件配置

  • --dir:指定组件目录路径
  • --title:指定组件标题

示例

# 在默认目录创建首页
npx mini-cli page index

# 在指定目录创建产品页面
npx mini-cli page product -- --dir plugins/live/pages/product --title "产品详情"

# 创建带有计数器功能的按钮组件
npx mini-cli component counter-button -- --dir plugins/live/components --title "计数器按钮"