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

generator-jiaoshou-activity

v1.0.1

Published

jiaoshou-activity generator

Readme

generator-jiaoshou-activity

基于 Yeoman 的活动页项目生成器,用于在 frontent-h5-static/act_project 下快速创建活动项目目录。

发布到 npm 后,对应命令为:

yo jiaoshou-activity

安装

npm install -g yo gulp-cli generator-jiaoshou-activity

如果本机使用了淘宝镜像安装依赖,可以这样安装:

npm install -g yo gulp-cli generator-jiaoshou-activity --registry=https://registry.npmjs.org/

使用

进入活动项目根目录:

cd E:\frame\tony-project\frontent-h5-static\act_project

执行生成命令:

yo jiaoshou-activity

根据提示输入项目文件夹名称,例如:

active-demo

生成后目录结构类似:

active-demo
├─ css
├─ html_tpl
├─ img
├─ js
├─ media
├─ slice
├─ .tmtworkflowrc
├─ gulpfile.js
└─ index.html

开发与打包

进入生成后的项目目录:

cd active-demo

安装依赖:

npm install --ignore-scripts

开发构建:

gulp build_dev

生产构建:

gulp build_dist

输出目录配置

生成项目里的 .tmtworkflowrc 可以配置打包输出根目录:

{
  "distDir": "../../modules"
}

如果在 act_project/active-demo 下执行 gulp build_dist,最终会输出到:

frontent-h5-static/modules/active-demo

如果不配置 distDir,则默认输出到:

frontent-h5-static/activity/项目名

需要指定完整输出目录时,可以使用:

{
  "targetDir": "../../modules/custom-name"
}

或:

{
  "outputDir": "../../modules/custom-name"
}

targetDir 和 outputDir 会按完整路径输出,不会自动追加项目名。

维护模板

模板文件位于:

generators/app/templates/project

常用维护入口:

generators/app/index.js
generators/app/templates/project/.tmtworkflowrc
generators/app/templates/project/gulpfile.js
generators/app/templates/project/index.html
generators/app/templates/project/css/index.scss
generators/app/templates/project/js/index.js

修改模板后,本地调试:

cd E:\frame\tony-project\generator
npm link
yo jiaoshou-activity

发布

发布前确认 npm registry 使用官方源:

npm config get registry

如果不是官方源,发布时指定:

npm publish --registry=https://registry.npmjs.org/

首次发布或登录:

npm login --registry=https://registry.npmjs.org/

发布前预览包内容:

npm pack --dry-run

发布:

npm publish --registry=https://registry.npmjs.org/

如果账号开启了 2FA:

npm publish --registry=https://registry.npmjs.org/ --otp=你的6位验证码

版本迭代

每次发布前必须升级版本号:

npm version patch
npm publish --registry=https://registry.npmjs.org/

版本号建议:

patch: 1.0.0 -> 1.0.1,修复模板问题
minor: 1.0.0 -> 1.1.0,新增模板能力
major: 1.0.0 -> 2.0.0,不兼容旧使用方式

验证发布结果

npm view generator-jiaoshou-activity version --registry=https://registry.npmjs.org/

安装最新版本测试:

npm install -g generator-jiaoshou-activity --registry=https://registry.npmjs.org/
yo jiaoshou-activity