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-moproj

v0.0.5

Published

Yeoman generator

Readme

#generater - moproj

前期准备

  • yoman相关安装:npm install -g yo bower grunt-cli gulp
  • 运行检查命令:yo doctor
  • 如果检查结果有问题,则根据yo doctor的结果,添加yo为全局变量。

安装

  • 安装脚手架:npm install generater-moproj -g
  • 创建新的项目文件夹,yoman脚手架使用:yo moproj

如何使用

  1. grunt启动:grunt
  2. 图片压缩:grunt imagemin—— 压缩img文件夹下的文件。
  3. build发布:grunt build

PS:grunt linveload监听所有scss、js、html文件,scss文件会自动编译为css文件。

js/css压缩block

ex - css

<!-- build:css button/base.min.css -->
<link rel="stylesheet" href="base1.css">
<link rel="stylesheet" href="base2.css">
<!-- endbuild -->
  • 上述代码会将base1,base2两个css文件合并、压缩为base.min.css。
  • 该段代码,会自动被替换为 <link rel="stylesheet" href="base.min.css">
  • 注意:在生成css文件路径前,需要将组件名写上,例如button/base.min.css

ex - js:

<!-- build:js button/c.min.js -->
<script src="a.js"></script>
<script src="b.js"></script>
<!-- endbuild -->
  • 上述代码会将a.js,b.js两个js文件合并、压缩为c.min.js。
  • 该段代码,会自动被替换为 <script src="c.min.js"></script>
  • 注意:在生成js文件路径前,需要将组件名写上,例如button/c.min.js

注意:所有css/js文件均需要卸载block块中,否则build发布完,dist文件夹中会没有该文件。

组件结构

  • 新的组件,需要在src文件夹中新建相关组件文件夹,js/css文件均直接在组件文件夹中,不再创建js/css等子文件夹。
  • 组件相关图片:如果图片不多,建议直接放在组件文件夹中即可。如果图片文件较多,则需要创建img子文件夹。
  • 组件的文件结构,参见popup- 弹层组件。

其他

  • bower:使用bower,来管理js框架等资源文件的版本等,依赖文件见配置文件bower.json,安装的资源文件安装见bower_components
  • npm镜像:建议使用cnpm镜像,以保证npm安装顺畅,设置方法如下:
    • npm config set registry https://registry.cnpmjs.org
    • npm get registry
  • win下推荐使用命令行工具:cmder